How to set up the Bass Audio Library for Qt 6 MinGW
-
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 -lbassI 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 -
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 -lbassI 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.\inINCLUDEPATHis your project dir..\inLIBSis 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
$$PWDrather than the dot to use the full path to your source folder. -
.\inINCLUDEPATHis your project dir..\inLIBSis 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"@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() { } -
Hi,
In addition to @Chris-Kawa, you can use
$$PWDrather than the dot to use the full path to your source folder.@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 -
8 8Observer8 has marked this topic as solved on