Skip to content

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

Description

@rggaur789

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions