Problem with linking OpenAL in Qt Creator under Windows
Hi all,
I've wasted many time to search how I should configure my Qt Creator to link OpenAL in my application so I try with posting my problem right here.
Well my problem is very simple:
I have Qt Creator 2.0.1 with Qt 4.7 and Windows 7 x64 and haven't got any problem before trying to link OpenAL.
I saw that I have to add my library to "LIBS" in my .pro file. So here is my .pro:
Code:
QT += core gui
TARGET = OpenALTest
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h\
sndfile.h
FORMS += mainwindow.ui
INCLUDEPATH += C:/OpenALSDK/include
LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
-LC:/OpenALSDK/libs/ -lopenal32
I downloaded OpenAL SDK which is composed (especially) of .h file that I include and an OpenAL32.lib file which I mention in my "LIBS" configuration variable.
The result I have is:
C:\Qt\2010.05\qt\OpenALTest-build-desktop/../OpenALTest/mainwindow.cpp:31: undefined reference to `_imp__alcOpenDevice'
C:\Qt\2010.05\qt\OpenALTest-build-desktop/../OpenALTest/mainwindow.cpp:39: undefined reference to `_imp__alcCreateContext'
C:\Qt\2010.05\qt\OpenALTest-build-desktop/../OpenALTest/mainwindow.cpp:47: undefined reference to `_imp__alcMakeContextCurrent'
...
I believe that my code won't help you because it's just a link problem but ask me if necessary.
I also tried with this:
Code:
LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
-LC:/OpenALSDK/libs/OpenAL32.lib
and
Code:
LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
C:/OpenALSDK/libs/OpenAL32.lib
May someone help me?
Thx
Re: Problem with linking OpenAL in Qt Creator under Windows
Hi,
I suggest to you to use fmodex instead of OpenAL ( I'm using it without problems building an audio editor ).
Regards
Re: Problem with linking OpenAL in Qt Creator under Windows
Well I've read Wikipedia's description about this library.
As it's written, this library is free to use for personal usage only but my project is a professional free project.
OpenAL is very simple to use and seems to be a good library but I've just a problem to link it in a Qt Creator project.
Any other suggestion?
Re: Problem with linking OpenAL in Qt Creator under Windows
I recently fixed the problem.
This works:
Code:
LIBS += C:/OpenALSDK/libs/OpenAL32.lib \
C:/Qt/2010.05/qt/OpenALTest/libsndfile-1.lib
I don't really understand why it works but it works. It might be a problem using back-slashes and slashes....