This article describes how you can setup your (free IDE) Visual C++ 2005 Express (VC++) to work with Qt, and to get Qt code completion.You can either use the mingw32 compiler, or the nmake compiler that comes with VC++, but the focus of this article is to use only nmake This article was first published on my blog. Any feedback to me you're more than welcome to post there. Similar articles written by other
people can be found under: Prerequisites (1 to 4)1)Download and install Microsoft Visual C++ Express edition in the
installation instructions they mention that you should ALSO install the SDK, don't forget to DO just that. Very
Important: Don't forget to follow the instructions on that page, since they
will describe how to setup the SDK to work for this version of Visual Studio.
NOTE that in these descriptions some files that may need to be deleted will be
HIDDEN so using the search or 'un-hide' files might be good.
Qt Installation (5 to 7)5)
You need to patch the vsvars32.batto setup the VC++ compiler
correctly. The cript that is found in 6 ) You can choose to use the Qt patchfor your Qt version (make sure you are
using the right one) - which should enable more compiler support for Qt. Without patch:make sure you are in %QTDIR% With patch:make sure you are in %QTDIR% If no error occurs you proceed then
to running the qconfigure.batscript
as 7)
Run nmakewhich will compile & install Qt. Setup VC++ Environment (8a to 8c)8a)Include files that you need when including Qt into
your source code I.e you should add 8c )Source files that you need to enable Intellisense to do Qt
code completion If you had an old project than maybe you also need close down VC++ and then
delete the IntelliSense file (*.ncb). Don't worry when you start the project
again the file will be re-created. Create your first project – Qt Hello World)OK, now you're ready to try your
first project. Since Qt already comes with a very easy and nice way to manage
the make system we're going to use that (For the lazy ones you get get my
example project here). TEMPLATE += app
Creating a new Project as such: Add a file also to the project:
int main()
Now set up your environment to
autogenerate Makefiles and compile according to your .pro file Anything else?When I tried to compile my first project (completely unrelated, but it was QuickFix) I ran into some trouble due to that the
wchar_twas defined in an incompatible way
in the old libraries compared to Visual Studio 2005 Express. This could be
rectified by setting up the QuickFix project so that the wchar_tshould use the code definition
rather than the VC++ definition. |


