www.XuvTools.org
Table of ContentsCompiling on Windows
The instructions given on this page are outdated, and remain here merely for documentation. Please use the up-to-date version that is linked from the navigation menu!
Prerequisites: currently this is Visual Studio 2008 and Qt (see below for Qt build-instructions). In addition, it is heavily recommended to use Intel's C++ Compiler for Windows to build XuvTools, and for a more comfortable way a cygwin-installation is heavily recommended. Building XuvToolsset environment variablesOpen a Visual Studio command prompt, and set up the environment for your windows compilation: set LMBSOFTSRC=C:\Data\emmenlau\src\XuvTools set LMBSOFTDEST=C:\Data\emmenlau\lmbsoft-win32 set LMBSOFTTEMP=%LMBSOFTDEST% set QTDIR=%LMBSOFTDEST%\Qt-<VERSION> set PATH=%QTDIR%\bin;%PATH% These variables should not contain spaces, or qmake will fail. Instead of setting the environment variables every time you qmake XuvTools, you can set them static for your Windows environment like described here by Microsoft. qmake projectAfter you have set the environment, call qmake to generate Visual Studio project files: cd %LMBSOFTSRC%\project\qt qmake -r -tp vc -spec win32-msvc2008 XuvTools.pro additional configuration flagsIf you want to build the command line tools as well, you can add “tools” to the qmake CONFIG variable. To build and execute the tests, you can add “test” to the qmake CONFIG variable. qmake CONFIG+="tools" -r -tp vc -spec win32-msvc2008 XuvTools.pro qmake CONFIG+="test" -r -tp vc -spec win32-msvc2008 XuvTools.pro qmake CONFIG+="tools test" -r -tp vc -spec win32-msvc2008 XuvTools.pro Windows x64 adjustmentsIf you want to compile for Win64, you need to add the “x64” target to the solution. This can be done in Visual Studio, or manually by search-and-replace. When using Visual Studio, note that Visual Studio will set back the values of some settings to their default (mainly the IntDir variable) when converting projects, so double-check your settings! The preferred way is therefore to use a text editor, or Cygwin with perl: cd $LMBSOFTSRC PROJECTFILES=$(find . -name \*cproj -o -name \*sln) perl -pi -e 's/Name="Win32"/Name="x64"/g;s/\|Win32/\|x64/g' ${PROJECTFILES} buildOpen the Visual Studio solution file “XuvTools.sln”. If you want to build for x64, make sure the Target is set to “x64” (see previous section). Select your target platform and configuration, and start the compilation. It is recommended to check the optimization settings beforehand, and/or use the Intel compiler. It is also recommended to build all projects whose name starts with “gen…” (Note: lowercase) before all other projects. This is because these are generators for header files. Building these projects first can reduce the overall building time. Problems and FixesFor Windows (32 /and/ 64 bit), Intel C++ Compiler (11.0.072 up to at least 11.1.038), Qt-4.5.2, xuvtools_gui has to be qmaked separately. This is due to a bug in all recent qmake-versions (currently 4.5.2), see the corresponding Qt task-tracker entry QTBUG-2839 (formerly this was 228286) and discussion 55670 in the Intel Developers Forum. The following workarounds have been reported to succeed most of the time:
For Windows x64, Intel 11.0.072, Visual Studio 2008, compilation of XuvImgProcd requires that the macro __INTEL_COMPILER be defined. This should be automatically the case when compiling with the Intel Compiler. Qt Build InstructionsIf you do not have Qt Software's Qt framework already installed, it is recommended to compile Qt from source using Visual Studio. If you want to use the Intel Compiler for compiling XuvTools, you don't have to use it for Qt as well (this was supposed to cause problems on earlier versions, but http://doc.trolltech.com/4.5/known-issues.html doesn't list anything about this any more so this should be fine). Now here is how to build Qt: To use Microsofts Compiler, open the Visual Studio command prompt for your target architecture, i.e.: Start → Programs → Microsoft Visual Studio 2008 → Visual Studio Tools → Command Prompt. To use the Intel Compiler, open the Intel Compiler command prompt for your target architecture, i.e.: Start → Programs → Intel Software Development Tools → Intel C++ Compiler → C++ Build Environment for Applications running on IA-32 (or Intel 64). set QTDIR=%LMBSOFTDEST%\Qt-<VERSION> set PATH=%QTDIR%\bin;%PATH% Set the QTDIR environment variable to point to a directory where Qt should be installed on Windows. Recommended is %LMBSOFTDEST%\Qt-<VERSION>. Instead of setting the environment variables every time you qmake XuvTools, you can set them static for your Windows environment like described here by Microsoft. Go to http://get.qt.nokia.com/qt/source/ and download Qt for Windows (qt-win-opensource-src-<VERSION>.zip). Extract Qt, and move the folder contents to QTDIR (so that configure.exe is at %QTDIR%\configure.exe) Now change the current directory to QTDIR, and configure Qt. The options are the same for win32 and x64. If you want to use the intel compiler, you should in the future be able to select “-platform win32-icc”, but this has to be tested more. Currently it is recommended to convert the project in Visual Studio to Intel Compiler. Among the useful but not required flags are “-static” to build a static Qt library and “-no-phonon” to leave out the fancy phonon style support: cd /D %QTDIR% # To use Microsofts compiler, set the "win32-msvc2008" platform: configure -platform win32-msvc2008 -no-incredibuild-xge \ -no-phonon -no-phonon-backend -no-webkit \ -debug-and-release -static # To use the Intel compiler, set the "win32-icc" platform: configure -platform win32-icc -no-incredibuild-xge \ -no-phonon -no-phonon-backend -no-webkit \ -debug-and-release -static Next step is to build Qt, so call nmake: nmake sub-src If you specify the sub-src target, nmake will build no demos and examples. This is required when building static. Its always recommended, because building examples and demos takes very long. If you are not building static and want the demos and examples, just call “nmake” without “sub-src”. Get four to six cups of coffee, come back half a day later, finished. You should have Qt libs in %QTDIR%\lib and includes in %QTDIR%\include. To save space, you can (but don't have to) remove all folders except bin\, include\, lib\, and mkspecs\. |
|||
|