Question

I compiled libraries with Visual Studio 2012 (portaudio and opus), and when I try to use them in a QT project tells me he didn't find the symbols.

However, when I remove the .lib file, I encounter another error saying me that the lib doesn't exist, so the lib is well found.

When doing a dumpbin.exe /SYMBOLS portaudio.lib I have the missing symbols, but with a _ in front of it!

I don't understand, first time manipulating libraries on Windows and it drives me crazy!

In my .pro I have:

win32:LIBS += -L$$PWD
win32:LIBS += -lopus
win32:LIBS += -lporaudio
Was it helpful?

Solution

The problem is that you are mixing 32 and 64 bit.

The symbol names with an underscore prefix happen to be in 32 bit libraries due to the __cdecl calling convention. This is not the case with 64 bit libraries where this theory is obsolete.

If you wish to build a 32 bit project, build 32 bit portaudio and opus, and configure your project for 32 bit accordingly.

If you wish to build a 64 bit project, use 64 bit library dependencies, i.e. build portaudio and opus so. Then make sure that you also have 64 bit project configuration for your own project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top