Qt + OF giving compile issues related to ofSoundPlayer.h

Caveat: I am very new to openFrameworks 0.11.2.

All of the examples seem to have compiled without issue in msys2 using the shell script included “buildAllExamples.sh”, with the exception of “category sound” examples. I can’t seem to build ANYTHING in QT, however. Possibly due to the unwanted inclusion of the sound libs.

The build step takes nearly 20 minutes to get to the point where it fails, but when it does, the errors seem mostly related to ofSoundPlayer.

As an example:

“undefined reference to ‘sf_open’: ofOpenALSoundPlayer.cpp”
“undefined reference to ‘mpg123_new’: ofOpenALSoundPlayer.cpp”

etc. etc… there are around 151 of these.

There are also a few errors like “relocation truncated to fit: IMAGE_REL_AMD64_SECREL against …” from ofxInputField.cpp.o

The project in question is just the following:

#include “ofMain.h”
#include “ofApp.h”

int main( ){
ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context

// this kicks off the running of my app
// pass in width and height too:
ofRunApp(new ofApp());


I also tried adding “#define TARGET_NO_SOUND” at the top of main.cpp, with no success.

Any help would be appreciated.

Drew Hamilton

UPDATE: 4:14pm… This appears to be an issue when working with both Ming32 and Ming64.

Hey @drewhamilton , maybe try downloading the nightly build. There have been a lot of changes since 0.11.2, including some for sound if I remember right. There is a link to the nightly builds at the top of the downloads page:

@TimChi Thanks! Appreciate the quick response. Good to know the community is active enough to get speedy replies.

I get a segmentation fault running 3DPrimitiveExamples compiled in MSYS2, but most of the other examples work. However, in QT creator, I can’t seem to get even emptyExample included in the template creator to work…

It also appears that the emptyExample from the QtCreator template fails like before, with a whole host of undefined references to classes in OF libs.

Here is a very short sampling:

C:/msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/13.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: C:/of_v20230511_msys2_mingw64_release/libs/openFrameworksCompiled/lib/msys2/libopenFrameworksDebug.a(ofImage.o): in function loadImage<unsigned char>': C:/of_v20230511_msys2_mingw64_release/libs/openFrameworks/graphics/ofImage.cpp:191: undefined reference to uriParseUriA’
C:/msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/13.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: C:/of_v20230511_msys2_mingw64_release/libs/openFrameworks/graphics/ofImage.cpp:195: undefined reference to uriWindowsFilenameToUriStringA' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/of_v20230511_msys2_mingw64_release/libs/openFrameworks/graphics/ofImage.cpp:199: undefined reference to uriParseUriA’
C:/msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/13.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: C:/of_v20230511_msys2_mingw64_release/libs/openFrameworks/graphics/ofImage.cpp:201: undefined reference to uriFreeUriMembersA' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/of_v20230511_msys2_mingw64_release/libs/openFrameworks/graphics/ofImage.cpp:206: undefined reference to uriFreeUriMembersA’

Sometimes it does take a while for people to respond. But the forum is generally pretty active I think.

Ugh I know nothing about windows and msys2. I think if you followed the setup process and are getting errors then hopefully someone who is more familiar can help.