Results 1 to 4 of 4

Thread: Problem with linking OpenAL in Qt Creator under Windows

  1. #1
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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:
    Qt Code:
    1. QT += core gui
    2. TARGET = OpenALTest
    3. TEMPLATE = app
    4. SOURCES += main.cpp\
    5. mainwindow.cpp
    6. HEADERS += mainwindow.h\
    7. sndfile.h
    8. FORMS += mainwindow.ui
    9. INCLUDEPATH += C:/OpenALSDK/include
    10. LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
    11. -LC:/OpenALSDK/libs/ -lopenal32
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
    2. -LC:/OpenALSDK/libs/OpenAL32.lib
    To copy to clipboard, switch view to plain text mode 
    and

    Qt Code:
    1. LIBS += -LC:/Qt/2010.05/qt/OpenALTest/ -lsndfile-1 \
    2. C:/OpenALSDK/libs/OpenAL32.lib
    To copy to clipboard, switch view to plain text mode 

    May someone help me?

    Thx

  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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
    Franco Amato

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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?

  4. #4
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Problem with linking OpenAL in Qt Creator under Windows

    I recently fixed the problem.
    This works:
    Qt Code:
    1. LIBS += C:/OpenALSDK/libs/OpenAL32.lib \
    2. C:/Qt/2010.05/qt/OpenALTest/libsndfile-1.lib
    To copy to clipboard, switch view to plain text mode 
    I don't really understand why it works but it works. It might be a problem using back-slashes and slashes....

Similar Threads

  1. linking problem under windows
    By grisson in forum General Programming
    Replies: 1
    Last Post: 13th July 2010, 19:11
  2. QT Creator Linking issues
    By sgrant327 in forum Qt Programming
    Replies: 14
    Last Post: 16th December 2009, 15:42
  3. Replies: 2
    Last Post: 25th November 2009, 23:44
  4. jom / Windows SDK libs linking problem
    By nooky59 in forum Qt Tools
    Replies: 3
    Last Post: 12th November 2009, 14:58
  5. Problem with linking QT at windows.
    By zygmunt in forum Installation and Deployment
    Replies: 1
    Last Post: 21st October 2008, 21:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.