PDA

View Full Version : Building qt-sql-mysql on Windows 7 with Visual Studio 2010



sandor
9th April 2011, 22:33
It works like a charm under linux and on my other developer machine having VS2005 and mysql 5.1. However, with mysql 5.5 and VS2010 it does not.

What I do:
1. Open VS Command Prompt
2. cd into Qt\4.7.2
3. configure -debug-and-release -no-exceptions -no-accessibility -stl -qt-sql-mysql -qt-sql-odbc -no-qt3support -platform win32-msvc2010 -I C:\mysql55\include -L C:\mysql55\lib -l libmysql
(The Nokia Qt documentation looks to be incorrect for mysql 5.5 as there is no "opt" directory)
4. nmake

->
Build goes well (actually it succeeds when there is no -qt-sql-mysql in the command line of configure);
however build fails with the mysql option. It show that there are 50 unresolved externals regardless that build is done against libmysql. My best guess is that there is some kind of library mismatch - I tried to build with -static and the default dynamic but no matter what I do, the linking error stays. I tried to install both the 32 and 64 bit mysql connectors (after removing the other and iterated through all the options). Should I be building the actual mysql library? Or do something else? Are there some more precise description on what to do? Would mysql 5.5 and Qt 4.7.2 work together?

I hope there is someone who has the answers. I am reading forums for two days now and losing hope.

Thanks,
Sandor