Issue compiling emscripten library (SOLVED)

Hi. I’m having some issues compiling libs with emscripten for a html5 native extension.

I’m trying to compile libwebm and apparently the symbol names differ. Running strings on the lib I compiled with emscripten yields _ZN9mkvparser10EBMLHeaderC2Ev, while the game seems to link against _ZN9mkvparser10EBMLHeaderC1Ev.

Is there a recommended way for compiling emstripten libraries for use with Defold? Any recommended emscripten version? flags?

Update: Apparently strings botched up. I did a regular grep through the .a file and apparently both symbols show up, which is correct. Now, question is, why isn’t my library linked with the extension? I placed an emscripten-compiled libwebm.a in lib/js-web. Is that correct?

I eventually managed to compile it. I had to use emscripten 1.30.0

@Mathias_Westerdahl The good news is that I ported the video player extension to the web. The bad news is that it’s crazy slow.

I made a pull request


Lot of time passed, but still we need to recompile libs for html build.

How did you manage to compile libwebm?
I tried emcmake cmake /path/to -G Xcode

that gives me an Xcode project, but result of building with xcodebuild doesn’t work -
lot of undefined symbols like __ZNK9mkvparser5Track10GetCodecIdEv

Maybe it’s problem with libvpx? My binary of libvpx.a is about 2MB and the only target I managed to build was “generic-gnu”

You can probably keep it a lot simpler if ju just use your own command line script.
E.g. look at our way of building the required library we used in our old extension:

Unfortunately it doesn’t seem we saved the script for building with emscripten, but I suspect it should work pretty much the same, just with a different compiler etc.

Unfortunately OSX build file is not working anymore, there is an issue with missing libstdc (no more in Xcode?)

With current libs - it works in editor but can’t bundle OSX.
After I recompiled libs on my mac - it’s not working neither in editor nor bundle :confused:

Any help from people familiar with compiling this libs are appreciated.