# Compiling BitCode to WASM HTML5

**URL:** <https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141>\
**Category:** FMOD Engine\
**Created:** [January 22, 2024, 10:34pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141 "2024-01-22T22:34:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vieo](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/vieo/32/6055_2.png) [@Vieo](https://qa.fmod.com/u/Vieo)\
**Post date:** [January 22, 2024, 10:34pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/1 "2024-01-22T22:34:22Z")

</div>

I’m getting an error when trying to compile FMOD Studio BitCode to WASM

- Using latest `2.02.20` HTML5 Package
- Using files from `api\studio\lib\fastcomp\bitcode`
- Running the [command](https://fmod.com/docs/2.02/api/platforms-html5.html#for-fmod-studio-runtime-api) referenced in the documents

`emcc -v`

```auto
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.52 (fa478400df3351f7153c0279bc638784d3d90334)
clang version 18.0.0git (https://github.com/llvm/llvm-project 0a3a0ea5914cb4633f4f4c14f1ddc46ce067061a)
Target: wasm32-unknown-emscripten
Thread model: posix

```

Error Message

```auto
emcc --bind -Os -s EXPORT_NAME="'FMODModule'" -s MODULARIZE=1 -s FORCE_FILESYSTEM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS="['cwrap','setValue','getValue']" -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -o fmodstudio.js fmodstudio.bc fmodstudio_bindings.bc
warning: overriding the module target triple with wasm32-unknown-emscripten [-Woverride-module]
1 warning generated.
warning: overriding the module target triple with wasm32-unknown-emscripten [-Woverride-module]
1 warning generated.
emcc: warning: EXTRA_EXPORTED_RUNTIME_METHODS is deprecated, please use EXPORTED_RUNTIME_METHODS instead [-Wdeprecated]
wasm-ld: warning: function signature mismatch: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev
>>> defined as (i32) -> void in /tmp/emscripten_temp_i0uzwob_/fmodstudio_bindings_1.o
>>> defined as (i32) -> i32 in /home/USERNAME/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc++-noexcept.a(string.o)

wasm-ld: error: /tmp/emscripten_temp_i0uzwob_/fmodstudio_bindings_1.o: undefined symbol: std:: __2::__ vector_base_common<true>::__throw_length_error() const
wasm-ld: error: /tmp/emscripten_temp_i0uzwob_/fmodstudio_bindings_1.o: undefined symbol: std:: __2::__ vector_base_common<true>::__throw_length_error() const
wasm-ld: error: /tmp/emscripten_temp_i0uzwob_/fmodstudio_bindings_1.o: undefined symbol: std:: __2::__ vector_base_common<true>::__throw_length_error() const
wasm-ld: error: /tmp/emscripten_temp_i0uzwob_/fmodstudio_bindings_1.o: undefined symbol: std:: __2::__ vector_base_common<true>::__throw_length_error() const

```

Wondering if anyone could help?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 29, 2024, 11:21pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/3 "2024-01-29T23:21:38Z")

</div>

Hi,

Thank you for all the information. Unfortunately, 3.1.52 no longer supports fast comp.

Could you please elaborate on why you are building `fmodstudio.js` yourself rather than using our provided build? We may be able to find an alternative solution.

---

<div class="post-metadata">

**Author:** ![kags](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kags](https://qa.fmod.com/u/kags)\
**Post date:** [September 6, 2024, 1:16am UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/4 "2024-09-06T01:16:34Z")

</div>

Hi, I use Defold game engine. There is a FMOD wrapper for lua to use with Defold.  
In version 1.7.1, Defold updated from Emscripten version 2.02.2 to Emscripten 3.1.55, and that broke the FMOD for Defold HTML5, because it was outdated compared to Defold’s.

I want to compile the bitcode of FMOD `2.02.05 patch1` to a newer Emscripten version 3.1.55. Is that possible? Can I have access to bitcode that are not fastcomp?(since it’s outdated)

Please see the original issue here

> <https://github.com/dapetcu21/defold-fmod/issues/32>
>
> !\[image\](https://github.com/dapetcu21/defold-fmod/assets/128184051/a5773189-7970…-4d50-89d5-3a0e4d31698f)
> 
> This error is shown in console when the fmod dependecy is added to the project.
> I was told it could be caused by fmod not working with the latest Emscripten?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [September 10, 2024, 1:26am UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/5 "2024-09-10T01:26:11Z")

</div>

Hi,

Thank you for bringing this to our attention. Unfortunately, I cannot provide those files. However, I have created a task to look into updating our Emscripten version.

---

<div class="post-metadata">

**Author:** ![dr\_infantil](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dr\_infantil](https://qa.fmod.com/u/dr_infantil)\
**Post date:** [November 18, 2024, 1:00pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/6 "2024-11-18T13:00:43Z")

</div>

Hi,

I am also very much interested in this topic, because I would love to use FMOD in my Defold project as well.  
Unfortunately, due to the limitations above, I have to stay at a very outdated Defold version.

Is there any news on the plan to upgrade to a newer emscripten version?

Thank you

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [November 19, 2024, 2:53am UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/7 "2024-11-19T02:53:59Z")

</div>

Hi,

We have recently upgraded the Emscripten version to the latest.

Please try updating your FMOD to 2.02.25. This should allow you to achieve what you’ve been aiming for now.

Let me know if the issue persists.

---

<div class="post-metadata">

**Author:** ![kags](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kags](https://qa.fmod.com/u/kags)\
**Post date:** [October 6, 2025, 1:21pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/8 "2025-10-06T13:21:53Z")

</div>

@Connor_FMOD @li_fmod

What emscripten version is in 2.03.09?  
I think I found conflicting information, or am I getting it wrong?

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/18313a70426d88f212e2793a3ad322b1a291d169.png)

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [October 6, 2025, 10:26pm UTC](https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141/9 "2025-10-06T22:26:46Z")

</div>

Hi,

Thank you for sharing the screenshots!

> [@kags](#):
>
> What emscripten version is in 2.03.09?

The emscripten version used in 2.03.09 is **3.1.67**.

> [@kags](#):
>
> I think I found conflicting information, or am I getting it wrong?

The reference you found mentioning v1.38.15 is from the much older 1.10.10 release, quite a while back.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/c642590b0c0eb60fb464ae3b6974e272c7a4ef8e.png)

Hope that clears things up!
