[Solved] Compiling 64bit Qt 4.7.3 using MinGW
-
The C++ libraries of Visual Studio and MinGW are not compatible, you must not mix them. And to avoid getting the wrong includes into the path, you should not use the Visual Studio command prompt. The best would be to open the MinGW command prompt. I don't know the exact path (I have no windows box at the hand right now), that has the right paths set in the environment.
-
[quote author="koahnig" date="1314440011"]Hi phlucious
you have provided quite a long list of details, which is certainly good. However, it is also quite complex to understand. So I might raise questions you have already answered. [/quote]No worries here. I'm just trying to be thorough, and I often find that the most obvious answer is the correct one.
[quote author="koahnig" date="1314440011"]My personal opinion is to use all service packs for visual studio. At least with msvc2005 I made reasonably good experience.[/quote]
I would if I could... I don't control the Visual Studio installation on my platform yet.[quote author="koahnig" date="1314440011"]Why are you starting the vs Command prompt, when you want to compile a mingw version? There you will get the additional msvc specific environment into your compilation. But you want to use mingw only.[/quote]
[quote author="Volker" date="1314488306"]The C++ libraries of Visual Studio and MinGW are not compatible, you must not mix them. And to avoid getting the wrong includes into the path, you should not use the Visual Studio command prompt. The best would be to open the MinGW command prompt. I don't know the exact path (I have no windows box at the hand right now), that has the right paths set in the environment.[/quote]
I had no idea that there was such a thing as a MinGW command prompt. I have had limited formal computer science training, so I don't yet fully understand the concept of a shell, or the differences between the command prompts (vanilla windows 7x64, visual studio x64, and mingw, for example), so I was shooting in the dark in terms of which command prompt to use. I'm open to reading a good source if you know of one. Does the standard windows CMD.exe lack certain environment variables that I would need to compile Qt using mingw?It might also be worth noting that I haven't yet installed the Qt SDK on my current machine since they just finished setting it up this morning. Would installing the SDK add some env variables and/or registry values that would help with the process?
Thanks to you both for your helpful replies.
-
[quote author="phlucious" date="1314641815"]
I would if I could... I don't control the Visual Studio installation on my platform yet.
[/quote]
Maybe you should talk to your computer administrator to update the service packs for vs.[quote author="phlucious" date="1314641815"]
I had no idea that there was such a thing as a MinGW command prompt. I have had limited formal computer science training, so I don't yet fully understand the concept of a shell, or the differences between the command prompts (vanilla windows 7x64, visual studio x64, and mingw, for example), so I was shooting in the dark in terms of which command prompt to use. I'm open to reading a good source if you know of one. Does the standard windows CMD.exe lack certain environment variables that I would need to compile Qt using mingw?It might also be worth noting that I haven't yet installed the Qt SDK on my current machine since they just finished setting it up this morning. Would installing the SDK add some env variables and/or registry values that would help with the process?
Thanks to you both for your helpful replies.[/quote]
There is no special mingw command prompt. You would use the standard command prompt of your windows system. cmd is good enough for mingw. When using the msvc command prompt you have the environment set for visual studio. Otherwise nmake and the acess to the compiler is missing. And you must not mix the output of the different compilers.If you like to compile Qt you do not necessarily require the whole SDK. However, all depends on what you are really trying to achieve. In general I recommend to focus on one platform. There is no need to have Qt for msvc and mingw at the same time during development. Therefore, as long as you have no very good reason to do otherwise stay with either platform until you are familar with it.
If you want to use msvc and have a licensed version of it you should use also vsaddin. This makes live a little easier.
-
[quote author="phlucious" date="1314642645"]I think an important and more fundamental question is this: In order to compile programs with Qt Creator, do I also have a version of Qt compiled using the same compiler?[/quote]
You can use Qt creator also with the visual studio compilers as a tool chain. However, you might be on your own to fiddle out a number of details. In my opinion certainly nothing for starters.
It is probably easiest to use Qt creator as it comes with the whole sdk on windows.
-
[quote author="koahnig" date="1314643786"]You would use the standard command prompt of your windows system. cmd is good enough for mingw. When using the msvc command prompt you have the environment set for visual studio. Otherwise nmake and the acess to the compiler is missing. And you must not mix the output of the different compilers. [/quote]
Thanks for the clarification. What do you mean about mixing the output of different compilers? Using components of Qt (Qt Creator, Qt library, Qt Examples, etc) compiled using different compilers?
[quote author="koahnig" date="1314643786"]If you like to compile Qt you do not necessarily require the whole SDK. However, all depends on what you are really trying to achieve. In general I recommend to focus on one platform. There is no need to have Qt for msvc and mingw at the same time during development. Therefore, as long as you have no very good reason to do otherwise stay with either platform until you are familar with it.[/quote]
I'm trying to achieve two things: First and foremost, I need to be able to develop 64bit programs for the speed and memory improvements that come with it. I'll be pounding through LiDAR data, which often means massive files. Anything I can do to go faster means hours saved. Since I prefer C++ with Qt, this means that I have to compile my own 64bit version of 4.7.3. I'm new to compiling libraries, though, so the learning curve is pretty steep.
Secondly, I've gotten used to Qt Creator and haven't used Visual Studio much for a year or two, so I'd prefer to develop there if I can do so in 64bit instead of downloading the VS add-in, especially since my admin has been slow about getting the service pack installed. Now seems as good a time as any to learn how to compile my own version(s) of Qt. I like having options.
-
[quote author="phlucious" date="1314644730"]
Thanks for the clarification. What do you mean about mixing the output of different compilers? Using components of Qt (Qt Creator, Qt library, Qt Examples, etc) compiled using different compilers?
[/quote]
Since you can use Qt creator as the IDE with the ms compiler this is not considered to be a mix.
A mix would be if you create a brand-new application with msvc and like to link with mingw libs. That is a nogo. If Qt is compliled with mingw, you can use it only for own applications compiled with mingw. The same hold true for msvc.Since you are familiar with Qt creator, it is probably the best choice to stay with it. If there are no restrictions to be compatible with other shared libs, you can use mingw. You might want check if the sdk is already readily available for 64 bit for windows. This would allow you to save the compilation of Qt.
Yes, LiDAR data is often more than just a couple of kB ;-)
-
Hi There,
Not a computerscientist? No problem...
1st: gcc and vc++ compiler work differently. This means, as the other guys said, that if you start to work with a given compiler, you have to keep working only with it (or you will have problems), easier and simpler.
2nd: Since you don't have too much background on computer science, keep it simple.
3rd: since you are a programmer, you will have to install several stuff to test, discover and see what fits best to you. I recommend that you speak with your boss about some changes on the policy, so that you can have a bit more freedom to work.
4th: Installation mingw64 is tricky, take a look at "these":http://sourceforge.net/apps/trac/mingw-w64/wiki/BuildingQt . You will need activePerl. Also use the latest win64 build (look at the txt on the download section of the page you have pointed:
Sorry, the link is getting corupted, so i am writting it for you to copy and paste:
http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/PersonalBuilds/sezero_20110510/
Chose the right one for your OS version.5th: maybe you could really request (edit: politely) to the admin to install Qt 64 bits for you, this is a bad thing, but if he is the only one with the power to do it, empower him. You are no magician :-)
Good Luck,
VitorAMJ -
Thanks to everyone for the helpful replies! I think I'm starting to understand the distinctions between IDE, library, compiler, and debugger.
I was unable to find a stable enough 64bit version of MinGW to suit my needs, so I purchased a copy of Visual Studio 2010 (with SP1) and compiled my own 64bit version of the Qt library (4.7.4) for use in the 32bit Qt Creator (2.3.1, standalone version). For those wondering, I found the instructions at the following link VERY helpful!
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/The instructions "here":http://doc.qt.nokia.com/qtcreator-snapshot/creator-debugger-engines.html were very helpful for setting up 64bit debugging of my 64bit msvc2010 build of Qt in Qt Creator using the Windows SDK.
Thanks again for your help! Hopefully soon Nokia/Trolltech will begin distributing 64bit versions of their libraries. I'm guessing that they're waiting for a stable version of 64bit MinGW that works with Qt.
Cheers,
Evon -
I'm confused about the definition of 64bit version binaries.
I have followed the http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
and seemingly successfully compiled Qt in my 64bit Windows 7 machine , but apparently it did not use "the x64 compiler" (as described http://doc.qt.nokia.com/4.7/install-win.html ) because I get
@QtCored4.lib(QtCored4.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
1>@ when I try to use Qt in a x64 projectand the demo executables don't run.
[where as with http://get.qt.nokia.com/qt/source/qt-win-opensource-4.8.0-vs2010.exe the same linker error occurs, but the executables run]Please give your input on what seems to be happening
-
Sounds like you have 32bit and 64bit libraries mixed. Either you didn't compile Qt in 64bit, or your other libraries or project settings in Visual Studio are still 32bit.
Make sure that you use the "Visual Studio x64 Win64 Command Prompt (2010)" when you attempt to compile Qt. I bring that up directly from my start menu. That's the only environment in which I've successfully compiled in 64bit. I use:
configure.exe -debug-and-release -opensource -platform win32-msvc2010 -no-qt3support
..\jom106\jom.exe -j 4
..\jom106\jom.exe cleanI gave up trying to install MinGW x64 and used MSVC2010 in Qt Creator like koahnig suggested. I don't use Visual Studio itself much as my IDE any more, so I can't help you there. You should probably start a new thread since this thread is about using MinGW.
-
Oh! I had missed the detail
[quote]Make sure that you use the “Visual Studio x64 Win64 Command Prompt (2010)” when you attempt to compile Qt. I bring that up directly from my start menu.[/quote]I didn't first realize that there were different command prompts in MSVS
Thanks!NOW I seem to have correctly compiled Qt in x64 (no linker error), but the demo executables weren't created..
I wonder why, got a clue? :)