U++ framework
Do not panic. Ask here before giving up.

Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Emscripten compilation & linking
Emscripten compilation & linking [message #61970] Fri, 10 April 2026 23:55 Go to next message
frederik.dumarey is currently offline  frederik.dumarey
Messages: 38
Registered: December 2021
Location: Belgium
Member
I'm trying to use TheIDE as build method for emcc.

Emcc has been setup correctly, with all path environment variables. So emcc --version is working fine.

I added a build method with some settings:
builder: gcc
compiler name: emcc
common options: -o output.html
common c++ options: -s WASM=1 -O3
INCLUDE dir to emscripten\system\include
BIN dir to emscripten\system\bin

But when I'm building using this method CTRL-F7 or F7 I get some directories created, but never the html,js and wasm files.


Regards,

Frederik Dumarey
Belgium
Re: Emscripten compilation & linking [message #61971 is a reply to message #61970] Sat, 11 April 2026 10:51 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1270
Registered: August 2007
Senior Contributor
Hi Frederik,

Unless you're trying to compile U++ into wasm (good news, I am porting it to it and Core is already ported), here's what you need:


WASM=1 is default, you don't need to explicity set it.
In link options set: -sENVIRONMENT=web

If you are compiling a cpp project, use em++ instead of emcc.

Don't set the -o in builder. Instead, in output mode, set the target file override to myfile.js.
E.g:

/forums/index.php?t=getfile&id=7149&private=0

Path:
PATH = "/usr/lib/emscripten;/usr/lib/emscripten/system/bin";

Path:
LIB = "/usr/lib/emscripten/system/lib;/lib";

This is for archlinux, but the correct paths should be similar in other distros or on windows.

Best regards,
Oblivion






[Updated on: Sat, 11 April 2026 10:52]

Report message to a moderator

Re: Emscripten compilation & linking [message #61972 is a reply to message #61971] Sat, 11 April 2026 16:31 Go to previous messageGo to next message
frederik.dumarey is currently offline  frederik.dumarey
Messages: 38
Registered: December 2021
Location: Belgium
Member
Hello Oblivion,

Thanks! Works perfectly.
Great to read that Core is already ported, can't wait to see CtrlLib ported too Wink

With your settings you get the Javascript and the Wasm file right, if somebody wants a html test file, just add the -o output.html setting, and you get a html file which you can serve using a local web server with python -m http.server [port]. Run the last command in the directory where the html, js and wasm file have been compiled.

This will be added to the book. Just for your information: I also made an example with the SDL library for a GUI tutorial, also working fine with this options.

Regards,
Frederik.


Regards,

Frederik Dumarey
Belgium
Re: Emscripten compilation & linking [message #62027 is a reply to message #61970] Sat, 27 June 2026 22:17 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1270
Registered: August 2007
Senior Contributor
Long time no news. Until now. Smile
Another milestone reached on the WebAssembly front: Draw and Painter are now native WASM citizens.
The road has been long, but the results speak for themselves: full 2D rendering, right in the browser, powered by U++. Cool

/forums/index.php?t=getfile&id=7169&private=0

More to come. Stay tuned.

Best regards,
Oblivion


Re: Emscripten compilation & linking [message #62028 is a reply to message #62027] Sun, 28 June 2026 10:38 Go to previous message
frederik.dumarey is currently offline  frederik.dumarey
Messages: 38
Registered: December 2021
Location: Belgium
Member
Great news!
Continue the good job I should say 😉, and keep us certainly posted...


Regards,

Frederik Dumarey
Belgium
Previous Topic: theide Compilation Error - UPP ver 18167
Goto Forum:
  


Current Time: Sun Jul 05 22:31:13 GMT+2 2026

Total time taken to generate the page: 0.00474 seconds