Hi there,
i tried to built a very simple application, just to test what SQL database plugins are installed:
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QtSql/QSqlDatabase>
#include <QStringList>
int main(int argc, char *argv[])
{
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QtSql/QSqlDatabase>
#include <QStringList>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << QSqlDatabase::drivers();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
This is all the code i've written. I know that this code worked in former versions of Qt, but now, it doesn't anymore. When I try to compile, i get this "symbol(s) not found for architecture x86_64" error.
Here's the complete output:
make: Entering directory `/.../MyProject-build-Desktop-Debug'
cd subProject/ && /usr/bin/make -f Makefile
make[1]: Entering directory `/.../My-build-Desktop-Debug/subProject'
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o dsp_Server main.o -F/Library/Frameworks -L/Library/Frameworks -framework QtCore
Undefined symbols for architecture x86_64:
"QSqlDatabase::drivers()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [dsp_Server] Error 1
make[1]: Leaving directory `/.../MyProject-build-Desktop-Debug/subProject'
make: Leaving directory `/.../MyProject-build-Desktop-Debug'
make: *** [subProject-make_default] Error 2
17:38:12: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project MyProject (target: Desktop)
When executing step 'Make'
make: Entering directory `/.../MyProject-build-Desktop-Debug'
cd subProject/ && /usr/bin/make -f Makefile
make[1]: Entering directory `/.../My-build-Desktop-Debug/subProject'
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o dsp_Server main.o -F/Library/Frameworks -L/Library/Frameworks -framework QtCore
Undefined symbols for architecture x86_64:
"QSqlDatabase::drivers()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [dsp_Server] Error 1
make[1]: Leaving directory `/.../MyProject-build-Desktop-Debug/subProject'
make: Leaving directory `/.../MyProject-build-Desktop-Debug'
make: *** [subProject-make_default] Error 2
17:38:12: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project MyProject (target: Desktop)
When executing step 'Make'
To copy to clipboard, switch view to plain text mode
I'm using Qt 4.8.2 under OS X 10.8.2. Can anybody help?
Thanks,
Markus
EDIT: Sorry for misfitting title... Before this problem occured, i had problems because i forgot to add the #include <QStringList> line (which also wasn't necessary the last time i used Qt)...
Bookmarks