How to set up the Bass Audio Library for Qt 6 MinGW
Solved
Game Development
-
I read this topic using Bass with MingW It seems like it is possible to use it with MinGW. But I have problems with Qt Creator settings.
My steps:
- I downloaded the Bass library here: https://www.un4seen.com/
- I added it to my project:
I include it like this:
INCLUDEPATH += ".\libs\bass24-windows\include" LIBS += -L".\libs\bass24-windows\x64" LIBS += -lbass
#include "widget.h" #include <bass.h> Widget::Widget(QWidget *parent) : QWidget(parent) { BASS_GetVersion(); }
I have this error:
error: cannot find -lbass
I tried to add
bass.dll
:INCLUDEPATH += ".\libs\bass24-windows\include" LIBS += -L".\libs\bass24-windows\x64\bass.dll"
But I have this error:
error: undefined reference to BASS_GetVersion
-
.\
inINCLUDEPATH
is your project dir..\
inLIBS
is your build dir, so if you have a shadow build next to your source tree the path is rather going to be something like this:LIBS += -L"..\show-version-bass-qt6-cpp\libs\bass24-windows\x64"
-
Hi,
In addition to @Chris-Kawa, you can use
$$PWD
rather than the dot to use the full path to your source folder. -
@Chris-Kawa thank you very much!
INCLUDEPATH += ".\libs\bass24-windows\include" LIBS += -L"..\show-version-bass-qt6-cpp\libs\bass24-windows\x64" LIBS += -lbass
#include "widget.h" #include <bass.h> Widget::Widget(QWidget *parent) : QWidget(parent) { BASS_GetVersion(); } Widget::~Widget() { }
-
@SGaist said in How to set up the Bass Audio Library for Qt 6 MinGW:
$$PWD
Yes, it works! Thanks!
INCLUDEPATH += ".\libs\bass24-windows\include" LIBS += -L$$PWD\libs\bass24-windows\x64 LIBS += -lbass
-