Using FMod library with Qt Creator crashes the program.
-
The same error in this post occurs . It seems that it can not find corresponding lib.
QT += core gui widgets TARGET = fmod TEMPLATE = app DEFINES += QT_DEPRECATED_WARNINGS CONFIG += c++11 SOURCES += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target INCLUDEPATH += "D:/FMOD Studio API Windows/api/lowlevel/inc" LIBS += D:\FMOD Studio API Windows\api\lowlevel\lib\fmod.dll
This is my pro file. I'm using minGW as compiler.
The fmod.dll file do exist.[+EDIT]
I found that it does not crash if I execute the result executable file directly. (Maybe this is because I added the lib path to system path).[+EDIT2]
It doesn't crash if I put the fmod.dll in the directory where result exectuable file is. Why does this happen? I can't understand why it can not find a dll file even though I specify the path of it. -
Hi @Aaron-Kim,
- if you use paths with spaces or non-ASCII chars in it, you can expect trouble everywhere. Please avoid this.
- The libs lines should be something like:
LIBS += -LD:/FMOD Studio API Windows/api/lowlevel/lib -lfmod
Note the forward slashes, the "-L" for the path and the "-l" for the linker include, not for the DLL!
And please, please rename
FMOD Studio API Windows
to something without spaces (e.g.FMOD_Studio_API_Windows
).Regards
-
Hi,
In the first one, you tell the linker where it can find the .lib file (either a static or import library) and the name of the library you want to link to.
The second line you just add the path to a .dll file which won't help because the linker don't know what to do with that kind of input.