1

I want to add an audio library into my project but when I try to do this, I get this error message:

cannot find -lOpenAL32d
cannot find -lEFX-Utild
error: ld returned 1 exit status

I added the libraries by "add library" and then I chose the correct paths to OpenAL 1.1. I'm not sure what I'm doing wrong but when I delete lines in .pro file with "INCLUDEPATH +=[...]" etc., I get completly different error, so it seems that the program detects those libraries but something is wrong though. Any suggestions what I could have done wrong?

EDIT: Posted .pro file. Version 1:

----------------------------------------------

QT       += core gui
QT += multimedia
QT += core

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = Apollo01
TEMPLATE = app

DEFINES += QT_DEPRECATED_WARNINGS

#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs 
deprecated before Qt 6.0.0


SOURCES += \
    main.cpp \
    mainwindow.cpp \
read.cpp

HEADERS += \
    mainwindow.h \
    read.h

FORMS += \
    mainwindow.ui

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32d

INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/include'
DEPENDPATH += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/include'

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/OpenAL32d.a'

returns

cannot find -lOpenAL32d

and the second version (used static option):

//[...]
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32d
else:unix: LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32

INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/include'
DEPENDPATH += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/include'

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/libOpenAL32.a'
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/libOpenAL32d.a'
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/OpenAL32.lib'
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/OpenAL32d.lib'
else:unix: PRE_TARGETDEPS += $$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/libOpenAL32.a'

returns

No rule to make target 'C:/Users/Kacper/Documents/Apollo01/../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/libOpenAL32d.a', needed by 'debug\Apollo01.exe'.  Stop.

1 Answers1

0

This is very much a kludge but it works for me on a windows 7 64 bit machine. Copy the OpenAL32.lib from C:\Program Files (x86)\OpenAL 1.1 SDK\libs\Win32 to the C:\ directory. Then have these lines in your .pro file. I did this because I could not work out how to get white-spaces to work in qmake. Hopefully this helps you somewhat.

INCLUDEPATH += "C:/"
LIBS += -L"C:/" -lOpenAL32

In your case I believe when you added the library using the gui you ticked add "d" suffix for debug version and to my limited knowledge that file does not exist. So first try deleting this line from your code.

else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/OpenAL 1.1 SDK/libs/Win32/' -lOpenAL32d
aschepler
  • 70,891
  • 9
  • 107
  • 161