Qt - Database Module in Windows 7 and Linux
Let me tell you how is my enviroment. I need my application to works in Windows 7 64 bits and in Linux 64 bits. Working in Linux is quite easy becase apt-get installs just what I need. If I need support for Database, apt-get install libqt4-mysql fix my problem and the code I generate with Qt-Creator is 64 bits native, since I use G++ 64 bits.
My problem bring up when I want to do the same in Windows 7 64 bits. If I download the SDK for windows, it uses MinGW32 bits. I mean, qt-creator use mingw32 to generate code, therefore the code generated is 32 bits. So, I decided to download the source and compile that with Visual Studio 2005 whose generate 64 bits. But I am not sure where the source code is. On other hand I think that source code can no be compiled using visual studio 2005. If so, please, could you tell me any work around to have my qt libraries in 64 bits in windows and with database support? at least for mysql…
Thanks in advance.
mingw is used to compile code, not to generate code. Code is text :-)
o, I decided to download the source and compile that with Visual Studio 2005 whose generate 64 bits. But I am not sure where the source code is.
Which source code? for Qt? it’s in the downloaded package.
On other hand I think that source code can no be compiled using visual studio 2005.
And why should source code not be compilable with MSVS2005? By the wy, windows7 is officially supported by MSVS2008. Look here [doc.qt.nokia.com]
If so, please, could you tell me any work around to have my qt libraries in 64 bits in windows and with database support? at least for mysql…
You have to compile Qt with a supported compiler for the correspondignplatform. MSVS2008 and 2005 both support compiling for 64 bit. And with the Qt distribution, there should be adescription, how to compile (call configure, nmake).
Okey, so, what is supposed I should say? “Generate 64 native object code?, executable?”
How do you compile using msvs2005, I have tried with nmake, but I didnt work.
On other hand I have license for VS2005 but not for VS2008. I could download express edition but I dont know how to generate 64 native (code, executable, object) with the express edition. I am not sure if it is possible.
So, what I should do is to download the source for VS2008 and compile it isnt it? but how should I choose database support to be included? By default, in the executable download, database drivers for mysql is not included.
Thans you very much in advance.
you might use QODBC. Then you should download mysql odbc connector from http://dev.mysql.com/downloads/connector/odbc/5.1.html
when you donwloaded Qt sources, unzip them to a folder: <QTDIR>.
Open a MSVS command prompt, go to <QTDIR>, call configure —help
then call configure with the parameters you need, there you casn specify, which DB-drives should be compiled. For some of them, you need some extra libraries (Orcale etc.).
when confige is through, you can call nmake and it builds Qt. But in between, you get go and have some coffee (or some more, it takes time). If you want to build Qt in a way, it can be statically linked, look at this wiki page (in the example, gcc is used, but static build with MSVS is nearly the same…): BuildStaticQtForWindowsWithGccGerman [developer.qt.nokia.com] I’m pretty shure, gcc can also build 64 bit binaries.
If you search thge wiki, you could also find this article: # # Building Qt Desktop for Windows with MSVC [developer.qt.nokia.com]
download the MSVS2008 compiled binaries of Qt and Qt Addin. It seems it’s not allowed to compile for MSVS2008 manually in OpenSource version.
This is wrong. The (L)GPL version does not have any constraints about the compilers. Qt/Nokia does not provide prebuilt binaries, though. Nothing prevents you from compiling yourself.
In earlier versions, the MSVS integration was not in Open source editiopns, and perhaps the MSVS configs. But is was never said, that compiler might not be used. Before 4.x (3?), k there was no open source version for windows….
with Qt 4.3, there was a minGW version for open source for windows [labs.qt.nokia.com]
As stated in that article, since 4.4 it is also open source for windows with MSVS compiler.