I am really stuck right now, everytime I try to compile my c++ programm I get output like this:
release/dialog.o:dialog.cpp:(.text+0x9e): undefined reference to `mysql_init@4'
release/dialog.o:dialog.cpp:(.text+0xe1): undefined reference to `mysql_real_connect@32'
Browsing the whole day to find workarounds, tutorials, whatever, reading tutorials, uninstalling mingw, mysql server, qt and installing everything again. I deleted qt again and build it from source... converted libmysql.dll with the 0.3 mingw-utils reimp.exe and dlltools.exe and so on, nothing helped.
before using QT (just notepad++ and mingw), I had linker warnings aswell, telling me something bout stdcall-fixup-disable, but the programms compiled and worked.
later i will reinstall everything again i think, the current setup isn't working better than other installations before i dont even know what i did building qt from source. is there any easy (normal, uncomplicated) way to get Qt, MinGW, C++, MySQL5.5 working together?
edit2: i corrected the code now, that i got it to work, this is some minimal code snippet to begin with:
#include <QtCore/QCoreApplication>
#include <QMYSQLDriver>
#include <qsqldatabase.h>
#include <QtSql>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
// insert other connection options here
if(!db.open()){
// dp not open, add some debug text and stuff, exit or retry
}
//db should be open at this place, add code here
return app.exec();
}