Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: 'stdio.h' file not found #32

Open
anthonybudd opened this issue Jan 29, 2021 · 0 comments
Open

fatal error: 'stdio.h' file not found #32

anthonybudd opened this issue Jan 29, 2021 · 0 comments

Comments

@anthonybudd
Copy link

Hi all,

I am trying to compile a simple Hello World Script.

#include <stdio.h>

char * c_hello() {
   return "Hello World"; 
}

I can compile it fine using mbebenita.github.io/WasmExplorer but when I try to compile it using the following command

./node_modules/.bin/wa compile -o HelloWorld.wasm HelloWorld.c

I get the following error

$> ./node_modules/.bin/wa compile -o HelloWorld.wasm HelloWorld.c
Compiling on darwin-x64 ...

clang HelloWorld.c 
 -c 
 --target=wasm32-unknown-unknown 
 -emit-llvm 
 -nostdinc 
 -nostdlib 
 -D WEBASSEMBLY 
 -isystem /Users/anthonybudd/Development/WebAssembly_HelloWorld/node_modules/webassembly/include 
 -o /var/folders/vl/3fkjykn52zdb88cv3flv75zr0000gn/T/wa1_7474HSLCSC30dn9g.tmp

HelloWorld.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
FAILED Error: code 1
    at ChildProcess.<anonymous> (/Users/anthonybudd/Development/WebAssembly_HelloWorld/node_modules/webassembly/cli/util.js:38:24)
    at ChildProcess.emit (events.js:200:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

FYI I know absolutely nothing about C. So apologies if this is a stupid question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant