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

Unable to build for wasm32-unknown-emscripten #24

Open
DSchroer opened this issue Jan 13, 2023 · 2 comments
Open

Unable to build for wasm32-unknown-emscripten #24

DSchroer opened this issue Jan 13, 2023 · 2 comments

Comments

@DSchroer
Copy link

From a empty project and adding tracing-wasm as a dependency. Building with cargo build --target wasm32-unknown-emscripten fails due to the following error:

= note: error: undefined symbol: main/__main_argc_argv (referenced by top-level compiled C/C++ code)
          warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols
          warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
          warning: _main may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
          warning: To build in STANDALONE_WASM mode without a main(), use emcc --no-entry
          Error: Aborting compilation due to previous errors
          emcc: error: '/usr/bin/node /usr/lib/emscripten/src/compiler.js /tmp/tmpxlhf40bq.json' failed (returned 1)
          
@colelawrence
Copy link
Member

I'm open to others taking a look. I haven't used this build triple and I don't recognize the error.

@happydpc
Copy link

There should set EMCC_CFLAGS flag value with -no-entry.

EMCC_CFLAGS="-g -s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry -s FULL_ES3=1"

//https://github.com/gfx-rs/wgpu/wiki/Running-on-the-web-with-Emscripten

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

3 participants