Build & run from qtCreator : libfmod.so.12

cannot run from qtCreator with error message

error while loading shared libraries: libfmod.so.12: cannot open shared object file: No such file or directory

it’s been working but I can’t remember when the error been occurred.

environment :

arch linux
OF 0.11.2
qtCreator v4.6.2

Hmm.
fmod shouldn’t be enabled by default on linux.

Are you trying to enable the ofFmodSoundPlayer or is this happening with the examples too?

no. I don’t.
I’ve tested two linux machine. one is new linux setup done fresh.

Could you try changes these lines in ofConstants.h and see if which warning you get when you compile?

//------------------------------------------------ soundplayer
// check if any soundplayer api is defined from the compiler
#if !defined(OF_SOUND_PLAYER_QUICKTIME) && !defined(OF_SOUND_PLAYER_FMOD) && !defined(OF_SOUND_PLAYER_OPENAL) && !defined(OF_SOUND_PLAYER_EMSCRIPTEN)
  #ifdef TARGET_OF_IOS
  	#define OF_SOUND_PLAYER_IPHONE
  #elif defined(TARGET_LINUX) || defined(TARGET_MINGW)
  	#define OF_SOUND_PLAYER_OPENAL
	#pragma message("WARNING: AUTO SELECTING OPENAL")
  #elif defined(TARGET_EMSCRIPTEN)
	#define OF_SOUND_PLAYER_EMSCRIPTEN
  #elif !defined(TARGET_ANDROID) && (!defined(USE_FMOD) || USE_FMOD)
  	#define OF_SOUND_PLAYER_FMOD
	#pragma message("WARNING: AUTO SELECTING FMOD")
  #endif
#endif

#if defined(OF_SOUND_PLAYER_FMOD)
#pragma message("WARNING: USING FMOD")
#endif

#if defined(OF_SOUND_PLAYER_OPENAL)
#pragma message("WARNING: USING OPENAL")
#endif

I think OPENAL selected.

btw, if I compile and run by make, make RunRelease, I don’t have libfmod.so issue. it only happen run from qtCreator

In file included from /home/icq4ever/oF/addons/ofxGui/src/ofxBaseGui.h:3,
                 from /home/icq4ever/oF/addons/ofxGui/src/ofxGuiGroup.h:2,
                 from /home/icq4ever/oF/addons/ofxGui/src/ofxGuiGroup.cpp:1:
/home/icq4ever/oF/libs/openFrameworks/utils/ofConstants.h:383:50: note: ‘#pragma message: WARNING: AUTO SELECTING OPENAL’
  383 |  #pragma message("WARNING: AUTO SELECTING OPENAL")
      |                                                  ^
/home/icq4ever/oF/libs/openFrameworks/utils/ofConstants.h:397:40: note: ‘#pragma message: WARNING: USING OPENAL’
  397 | #pragma message("WARNING: USING OPENAL")
      | 

Ah okay - that makes more sense.
It must be something in the switch from libfmodex to libfmod with the QtCreator files.

Not really an ideal fix but you could try adding a line for fmod here:

This would disable linking fmod on linux.

Another fix would be to rename libfmod.so in libs/fmod/lib/linux64/ to
libfmod.so.12 and make a symlink to it named libfmod.so

If that second approach works for you we can fix this in the next release.

hmm… second approach I tried. but nothing changed.

is this right?

icq4ever@p340:~/oF(master⚡) » cd libs/fmod/lib/linux64 
icq4ever@p340:~/oF/libs/fmod/lib/linux64(master⚡) » ls
libfmod.so
icq4ever@p340:~/oF/libs/fmod/lib/linux64(master⚡) » mv libfmod.so libfmod.so.12
icq4ever@p340:~/oF/libs/fmod/lib/linux64(master⚡) » ln -s libfmod.so.12 ~/oF/libs/fmod/lib/linux64/libfmod.so
icq4ever@p340:~/oF/libs/fmod/lib/linux64(master⚡) » ls -al
total 1604
drwxr-xr-x 2 icq4ever icq4ever    4096  4월  9 02:40 .
drwxr-xr-x 3 icq4ever icq4ever    4096  1월  3 09:25 ..
-rwxr-xr-x 1 icq4ever icq4ever     212  1월  3 09:25 ._libfmod.so
lrwxrwxrwx 1 icq4ever icq4ever      13  4월  9 02:40 libfmod.so -> libfmod.so.12
-rwxr-xr-x 1 icq4ever icq4ever 1627616  1월  3 09:25 libfmod.so.12

Hmm - yeah I think that is what I was hoping would work. :slight_smile:
I wonder if you have to copy both to the bin/ folder where your executable lives?

btw I think the ln command should be:
ln -s libfmod.so.12 libfmod.so

I’ll see if I can recreate the issue on Ubuntu. I think it is an issue I am seeing on other forums with the latest fmod.

1 Like

I copied libfmod.so.12, generate symlink in bin folder. but not resolved.
image

Hi, exactly the same issue here, on the same os

why not use code under arch instead of QT ?
i used under arch and everything works just fine

any development? same issue here, works fine when compiled using makefile and when i copy libfmod.so from the working directory, to the location of binary built using qtcreator, it gives same error.

Hi, I’m facing the same issue but in Opensuse Tumbleweed. Were you able to fix this?

Same issue here on ubuntu 21.04. I just add a line “fmod” to libseceptions section in the file libs/openFrameworksCompiled/project/qtcreator/modules/of/of.qbs. And qtcreator works now.

Thanks for the continued efforts on integrating FMOD in OF.

Trying to get FMOD working in an OF 0.11.2 project (of_v20211012_linux64gcc6_nightly) on Linux Ubuntu. Fresh install. Bumping into this same issue:

/apps/myApps/fmodTest/bin/fmodTest_debug: error while loading shared libraries: libfmod.so.12: cannot open shared object file: No such file or directory

Tried all the suggestions and took these steps:

  1. in libs/openFrameworksCompiled/project/qtcreator/modules/of/of.qbs adding “fmod” in libsexceptions

  2. added relative path to fmod.h in ofFmodSoundPlayer.h and project class file to fix errors ‘unknown type name’

extern "C" {

#include "../../../../libs/fmod/include/fmod.h"

#include "../../../../libs/fmod/include/fmod_errors.h"

}

To get to the point that the project builds and runs from QT. But only from QT, when running make it builds but when running make RunRelease the original error appears again. Tried copying to libfmod.so.12 in the lib folder or bin folder but does not help.

With project in QT when using any fmod function like:
FMOD_System_Create(&sys);

It results in the error:
undefined reference to 'FMOD_System_Create'.

Example source files attached for reproduction.

fmodTest-src.zip (2.4 KB)

Any hints on how to move forward on this? Thank you.

@arne you are trying to do something very different to the other people in this post. They are getting an FMOD error when not specifically using FMOD. You are (apparently) specifically wanting to use FMOD. You are getting those errors because you aren’t linking to FMOD, you have just included the header files.

To link you need to open up the qtCreator project and add the static or dynamic library you want to link against (and make sure that library can be found):

e.g.

        of.staticLibraries: []  // static libraries
        of.dynamicLibraries: ['fmod'] // dynamic libraries

That would link to a libfmod.so file…if that’s what you are linking against.

Hello @grimus, thanks for your advice. With your directions I managed to link the FMOD library.

Took these steps:

a) copied lib files libfmod.so & libfmod.so.12 (copied & renamed) to project root:

./libs/
./bin/libs/

b) in the project .qbs file add:

of.includePaths: ['libs']     // include search paths
of.dynamicLibraries: ['fmod'] // dynamic libraries
cpp.libraryPaths: ['libs']

c) build and run in qt or use make in terminal both works now

Observations:

  • make copies the library to ./bin instead of ./bin/libs; can’t link then so copied it manually there
  • make copies libraries that end in *.so but with the regex skips files that are named like *.so.12

Happy FMOD coding ahead with this now :wink: