emscripten-core / emscripten-core/emscripten

[Question] Using Scons to compile with Emscripten

Open
#18,114 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I am trying to compile for web using emscripten with Scons this simple program:

`#include `
`#include `
`void loop()`
`{`
`printf("Hello world!\n");`
`}`
`int main(int argc, char ** argv)`
`{`
`emscripten_set_main_loop(loop, -1, false);`
`return 0;`
`}`

With scons I am using the scons tools that is inside this repository for emscripten:

`import os`
`env = Environment()`
`os.environ["EMSCRIPTEN_ROOT"] = "C:/Users/oriol/OneDrive/Documentos/emsdk-main/upstream/emscripten"`
`env.Tool("emscripten", toolpath = ["C:/Users/oriol/OneDrive/Documentos/emsdk-main/upstream/emscripten/tools/scons/site_scons/site_tools/emscripten"])`
`env.Program("Test", ["main.cpp"])`

When I run scons, emscripten is generating this output error: 'python' is not recognized as an internal or external command, operable program or batch file. However, I have installed python 3.10.7 and its path is set to the system. So I do not understand why it is not recognized.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.