Opus codec lib function not compiling in Qt Creator

32 Views Asked by At

I am trying to build my application on Qt Creator IDE (which has Opus lib included), here's the .pro file:

QT       += core gui
QT       += network
QT       += xml
QT       += concurrent
QT       += widgets
QT       += multimedia

CONFIG += qt \
    thread \
    lrelease


QMAKE_LFLAGS += -F /System/Library/Frameworks/CoreFoundation.framework/

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

INCLUDEPATH += src

DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
    CUSTOM_MODES \
    _REENTRANT

LIBS += -framework CoreFoundation \
    -framework CoreServices \
    -framework CoreAudio \
    -framework CoreMIDI \
    -framework AudioToolbox \
    -framework AudioUnit \
    -framework Foundation \
    -framework AppKit


HEADERS += \
    Buffer.h \
    CLClient.h \
    Protocol.h \
    CLVariables.h \
    Channel.h \
    Global.h \
    Server.h \
    SignalHandler.h \
    Socket.h \
    Sound.h \
    SoundBase.h \
    mainwindow.h

SOURCES += \
    Buffer.cpp \
    CLClient.cpp \
    Protocol.cpp \
    CLVariables.cpp \
    Channel.cpp \
    Global.cpp \
    Server.cpp \
    SignalHandler.cpp \
    Socket.cpp \
    Sound.cpp \
    SoundBase.cpp \
    main.cpp \
    mainwindow.cpp


FORMS += \
    mainwindow.ui


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../opt/homebrew/cellar/opus/1.4/lib/release/ -lopus
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../opt/homebrew/cellar/opus/1.4/lib/debug/ -lopus
else:unix: LIBS += -L$$PWD/../../../../../../opt/homebrew/cellar/opus/1.4/lib/ -lopus

INCLUDEPATH += $$PWD/../../../../../../opt/homebrew/Cellar/opus/1.4/include/opus
DEPENDPATH += $$PWD/../../../../../../opt/homebrew/Cellar/opus/1.4/include/opus

The include works fine, there's no error, but when I call the function opus_custom_mode_create It occurs a compiling error:

ld: Undefined symbols:
  _opus_custom_mode_create, referenced from:
      CLClient::CLClient(unsigned short, unsigned short, QString const&, QString const&, bool, bool) in CLClient.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ChaosLive.app/Contents/MacOS/ChaosLive] Error 1
20:26:53: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project ChaosLive (kit: Qt 6.6.0 (6.6.0))
When executing step "Make"

When I open the opus_custom_mode_create function using cmd + left click, it opens the file where the function is correctly, plus there's no syntax error, just this one. What should I do?

0

There are 0 best solutions below