General environment questions



  • Hello. I have been using the QT Creator IDE for a while now, and I don't have a single complaint about it sofar. That said, the potential needs of my project have expanded greatly and I have several questions that I hope somebody can either answer or reference me to somplace that provides a clear answer.

    Basically, these questions stem from the fact that I must (1) Support 64-Bit platforms and (2) Maintain platform independence for my application (with platform specific code used when necessary). I am clear on how C++ works, but I don't have the experience with compilers and debuggers to determine what I need to do this.

    If my development environment is 64-Bit Windows 7 and I am using the latest stable QT Creator build, how do I ensure that I can build for both 32 and 64-Bit platforms (Windows is the priority at the moment, but Mac/Linux compatibility is something I'd love to go back and perfect later)? Is the MSVC compiler better for this since I'm working on Windows? If so, how do I use it with QT Creator? I see you can install libraries for VS 2010 (Which I have access to but don't like nearly as much as QT Creator), but I can't seem to find anything that tells me how to use that compiler with QT Creator. If there is a way to use the VC2010 compiler, can I also still use MinGW for some projects?

    Thanks for anybody who answers. Hopefully I've said enough that you can tell what I'm asking, but if not let me know what you need to know. I am very new to the multi-compiler and 64-Bit world.



  • Using the Visual Studio compilers together with Qt creator is an easy task. Just go to the Preferences / Build and Execution / Qt Version. Either the installer based version is already listed there or you will have to add it manually. You will need to add the path to the qmake of that installation. Creator usually detects the correct tool chain (MinGW or MSVS). You can set the toolchain to use on a per project base. Just go to the project view on the left and select the correct Qt version.

    For 32/64 bit: On windows you definitely need two separate builds of Qt for that, as each uses a separate toolchain. Also, your application must be built separately for 32 and 64 bit. If you use an installer, like InnoSetup or the like, you might put the two different builds into one big package and install one of it depending on the architecture of the target machine. I don't know if prebuilt packages are available for 32 and 64 bit for your desired version of Visual Studio. You'll have to build the missing one yourself.

    The same holds for Linux.

    On the Mac, the situation is different. OS X supports the concept of "universal binaries":http://en.wikipedia.org/wiki/Universal_binary. Those combine the object code for different bit sizes (32/64 bits) and/or different architectures (Intel/PowerPC) in one single file. You will need only one build of Qt and only one build of your application here. It's likely that you will have to build Qt manually here in order to make all architectures needed. That's usually not a big deal.

    Just a last strong advice: If you do build Qt manually, always use the vanilla sources from http://qt.nokia.com/downloads/downloads#qt-lib (use the links from "The source code is available as...") - reconfiguring the sources bundled with a binary build or the SDK will lead to serious trouble.



  • Thank you, Sir.

    Just to make sure I'm interpreting correctly: When you refer to a "separate build of QT" that means the QT libraries for that compiler and not the creator itself. Each of these libraries, in turn, could be referenced by the appropriate compiler when used in a QT Creator project.

    If I install the VS SDK 7.1 does this have all the compile/link/debug support I need for QT Creator, or would I need to install the full VS Suite to do what I want to do?

    It's quite a jump from doing simple 32-bit programming for Windows-.

    Again, thank you for helping a beginner.



  • Yes, it's just a matter of building the Qt libs. Qt Creator, as can be downloaded from Nokia, is capable of using all supported toolchains at once. You don't need to rebuild Creator for this.

    For the needed downloads, I don't know exactly. At least the command line tools of Visual Studio (compiler, linker, etc.) is needed. Creator does not use the IDE stuff of VS.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.