# How can I use Fmod's upstream static library in my H5 game

**URL:** https://qa.fmod.com/t/how-can-i-use-fmods-upstream-static-library-in-my-h5-game/18758
**Category:** FMOD Engine
**Created:** [May 13, 2022, 9:14am UTC](https://qa.fmod.com/t/how-can-i-use-fmods-upstream-static-library-in-my-h5-game/18758 "2022-05-13T09:14:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lxy1114](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lxy1114](https://qa.fmod.com/u/lxy1114)
#### Post date: [May 13, 2022, 9:14am UTC](https://qa.fmod.com/t/how-can-i-use-fmods-upstream-static-library-in-my-h5-game/18758/1 "2022-05-13T09:14:13Z")

</div>

I use urho3d to make my H5 game and write it directly in C + +.  
I used phaser3 before. It is a JS game framework. I will load the wasm library provided by Fmod through JS and work well.  
Now I write my H5 game in C + +, and I try to connect directly to the static library provided by Fmod (Fmod. A|fmod\_bindings. A|fmodstudio. A|fmodstudio\_bindings. A, etc.)  
You can compile directly through EMCC or emcmake. But when running, my browser console will report an error.  
I didn’t find a detailed way to use the static library provided by Fmod in H5. I think we should be able to call the method of Fmod directly through C + +, or we must write the JS part, call JS through C + +, and then JS calls the wasm of Fmod.  
Thank you very much for asking for a tutorial.

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [May 20, 2022, 7:02am UTC](https://qa.fmod.com/t/how-can-i-use-fmods-upstream-static-library-in-my-h5-game/18758/2 "2022-05-20T07:02:27Z")

</div>

We have some [information in the docs](https://fmod.com/resources/documentation-api?version=2.02&page=platforms-html5.html#building-a-cc-program-that-uses-fmod-libraries) about additional requirements for compiling a C/C++ FMOD application into html5 using Emscripten.  
To compile an application that uses FMOD, you need to compile your application with the fmod\_bindings.a, fmod\_js.a and fmod.wasm libraries found in the “ **upstream/w32** ” directory.  
Here is an example emscripten compilation command:

```auto
emcc main.c fmod_bindings.a fmod_wasm.a fmod_js.a -o index.html -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','setValue','getValue']

```
