I get the error:
wasm-ld: error: lto.tmp: undefined symbol: main
Because I try to compile a C or C++ file with Clang compiler to wasm32-wasi. I have defined:
-Wl,--no-entry
But it still insists of there being main() function present. The only way I can stop that is by doing:
-nostdlib
Which works, but then I can't include any library headers or use anything. I was wondering why I can't disable the main entry point without disabling support for the standard library? This goes both for C and C++. My full command is:
zig c++ ./WebAssemblyCompilationTesting.cpp -o myoutput.wasm --target=wasm32-wasi -Wl,--no-entry -g0 -Wl,--strip-all -O3 -nostdlib
zigisn't Clang - and C++ isn'tzig- so please explain your command-line for us.--target=wasm32-wasias an option for Rust - not for Zig or Clang. I honestly don't know what's going on here.