I want to employ FMOD into a working game (air hockey). I already have an example that works, but there is a number of problems that arise from this since I’m not very well versed in FMOD and makefile syntax.

The makefile of the example is the following:

x86: main.cpp
g++ -O2 -m32 -o example $< ../../api/lib/libfmodex.so

x64: main.cpp
g++ -O2 -m64 -o example $< ../../api/lib/libfmodex64.so

x86_c: main.c
g++ -O2 -m32 -o example $< ../../api/lib/libfmodex.so

x64_c: main.c
g++ -O2 -m64 -o example $< ../../api/lib/libfmodex64.so


rm -f example

I want to know how I can make use of FMOD in the air hockey game. First I need to figure out what to put into air hockey’s makefile. As I understand, the makefile of the example figures out what architecture and language are used. But what do I need to put into air hockey’s makefile to have the game use the FMOD library? What flag do I have to put in what list of flags?

Also, what do I have to do to show that a set of lines is a block of code in this post?

Remember, I’m just a noob, and any help is very much appreciated.

  • Andrey.
  • You must to post comments

You need to link libfmodex.so into your game if you are making a 32bit game and libfmodex64.so if you are making a 64bit game.
From the example the flags are broken down like this:

g++ (invoke the compiler)
-O2 (optimization level 2)
-m32 (32bit compile)
-o example (output executable name is ‘example’)
$< (makefile syntax for grabbing the main.cpp from the above line, you could just replace this with a space separated list of code files)
../../api/lib/libfmodex.so (path to the FMOD library you want to link)

So in practice you really only need the last bit added to your game makefile.
You may also benefit from using "-Ipath/to/fmod/includes" (without the quotes).

To add a code block to a forum post, when writing the post see the buttons above the input box? Select the code and press the ‘code’ button, it will wrap the text in code tags.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.