Prerequisites:
- Microsoft Visual C++ 9.0 (e.g. Express Edition), aka VS 2008 must be installed.
Qt compilation:
- Download the qt source from here: http://trolltech.com/developer/downloads/qt/windows
- Unzip the contents of the zip to (for example): 'c:\qt\4.4.0' (so 'configure.exe' is located in 'c:\qt\4.4.0').
- In order to avoid lots of compiler warnings, edit the file 'c:\qt\4.4.0\mkspecs\win32-msvc2008\qmake.conf' by removing '-w34100 -w34189' from the line 'QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189'. (Warning 4100 indicates unused function parameters, which will happen all the time. Warning 4189 shows initialized but unused variables, which is common in the release build).
- Open Environment Variables (In Windows Vista: Control Panel, System and Maintenance, System, Advanced system Settings, Environment Variables).
- Add the 'System Variable' named 'QTDIR' and set its value to 'c:\qt\4.4.0'.
- If it doesn't exist yet, add a 'System Variable' named 'QMAKESPEC' and set its value to 'win32-msvc2008'.
- Append ';c:\qt\4.4.0\bin' to the 'Path' variable
- Run a console with the VS 2008 paths set. Do this by selecting 'Tools' - 'Visual Studio 2008 Command Prompt' in Visual Studio 2008.
- In the console, navigate to 'c:\qt\4.4.0' (type 'c:' followed by 'cd c:\qt\4.4.0')
- Type 'configure', enter 'y'
- Type 'nmake'
Visual Studio Integration (recommended)
- Add 'c:\qt\4.4.0\include' to the include paths in VS 2008
- Add 'c:\qt\4.4.0\lib' to the library paths in VS 2008 (not necessary when using nmake, but it helps IntelliSense finding the Qt header files)
- Create desktop shortcuts to 'bin\designer.exe' and 'bin\assistant.exe'
- Associate '.ui' files with 'bin\designer.exe'
1 comment:
How can I set up VS 2008 to properly build the project. I have followed those steps but I get a linker error: error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE@XZ) referenced in function _main
Post a Comment