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

Error While creating hello world with cout in c++ #22401

Open
rggaur789 opened this issue Aug 19, 2024 · 3 comments
Open

Error While creating hello world with cout in c++ #22401

rggaur789 opened this issue Aug 19, 2024 · 3 comments

Comments

@rggaur789
Copy link

Hi,

I have tried the below simple c++ code

#include <iostream>

int main() {
    std::cout << "Hello World!\n";
    return 0;
}

with command emcc main.cpp -o file.wasm -s STANDALONE_WASM

and wasmtime file.wasm

but I am getting

Error: failed to run main module `file.wasm`

Caused by:
    0: failed to instantiate "file.wasm"
    1: unknown import: `env::_tzset_js` has not been defined

I am using emscripten and wasmtime latest versions. Can you please help what I am doing wrong here?

@kripken
Copy link
Member

kripken commented Aug 20, 2024

I believe this was fixed in #22316. That is not yet in a release, but you can use a tip of tree build, emsdk install tot.

@rggaur789
Copy link
Author

@kripken , also File handling will also work fine if I will use tip of tree build ?

@kripken
Copy link
Member

kripken commented Aug 22, 2024

@rggaur789 File handling support in standalone mode is pretty limited atm. There is some work on that here, but it has not landed: #18285

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

2 participants