Error attempting to compile with Emscripten


I’m trying to use emscripten to convert my project into javascript. I successfully compiled one of the examples but when I tried to compile my own project I received this error:

In file included from /Users/acgillette/Documents/dev_folder/of_v0.9.8_osx_release/addons/ofxOsc/src/ofxOscParameterSync.cpp:8:
In file included from /Users/acgillette/Documents/dev_folder/of_v0.9.8_osx_release/addons/ofxOsc/src/ofxOscParameterSync.h:11:
/Users/acgillette/Documents/dev_folder/of_v0.9.8_osx_release/addons/ofxOsc/src/ofxOscReceiver.h:96:2: error: unknown
      type name 'ofThreadChannel'
        ofThreadChannel<ofxOscMessage> messagesChannel;
/Users/acgillette/Documents/dev_folder/of_v0.9.8_osx_release/addons/ofxOsc/src/ofxOscReceiver.h:96:17: error: 
      expected member name or ';' after declaration specifiers
        ofThreadChannel<ofxOscMessage> messagesChannel;

Is this an issue of it not linking a library? It seems to be compiling the addons but I’m not sure why it’s having an issue with this one particular class.


javascript doesn’t support threads so anything related to threads in OF is not supported


Oh jeez, is there any way to work around this then? Or should I give up on trying to port this project into javascript? I was hoping to use it as part of a web app.


not right away, you would need to remove every thread and run everything in the main thread. also ofxOsc or network stuff won’t work directly either. you can do networking in javascript but using websockets which you would need to call using emscripten’s capabilities to call javascript by now since we don’t have a direct c++ api yet.


I actually don’t need ofxOsc networking now that I think about it, I only had it since I’m working out of the OpenFrameworks essentials book. Is there a simple way to remove an addon from an openFrameworks library? Also thanks so much for the clarification :slight_smile:


I removed the ofxOsc addon and it compiled, but on running I get this error:

[86241:775:0419/] Request for unknown Channel-associated interface: ui::mojom::GpuMain
missing function: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc
warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling
exception thrown: abort(-1) at Error
    at jsStackTrace (http://localhost:6931/VideoSynth.js:1:24028)
    at stackTrace (http://localhost:6931/VideoSynth.js:1:24199)
    at abort (http://localhost:6931/VideoSynth.js:24:169563)
    at __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc (http://localhost:6931/VideoSynth.js:1:297196)
    at oec (http://localhost:6931/VideoSynth.js:9:55003)
    at LIa (http://localhost:6931/VideoSynth.js:6:184294)
    at JIa (http://localhost:6931/VideoSynth.js:6:183849)
    at sJa (http://localhost:6931/VideoSynth.js:6:212180)
    at Object.Jg [as _main] (http://localhost:6931/VideoSynth.js:10:268)
    at Object.callMain (http://localhost:6931/VideoSynth.js:24:167958)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
missing function: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc


that seems like an emscripten issue like a function was missing in the emscripten port of the standard library or something but not sure.

You can try compiling in debug to see if you get any more info about where it comes from or adding the suggested flags in config.make in PROJECT_CFLAGS