Build Qt with STLport on Windows

Thank you to Kervala.

For this howto, i will use the Windows XP folder Program Files.
Replace it for Windows Vista or 7.

What you need

  • Microsoft Visual Studio C++ 2008 Express Editions with SP1

http://www.microsoft.com/downloads/details.aspx?FamilyID=f3fbb04e-92c2-4701-b4ba-92e26e408569&displaylang=en

Download vcsetup.exe

  • Microsoft .NET Framework 4

http://www.microsoft.com/downloads/details.aspx?familyid=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en

  • Microsoft Windows SDK

http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en

Working too with Windows XP SP2

  • Qt lib source for Windows (VS2008)

http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip

  • stlport (ryzom core external lib)

https://sourceforge.net/projects/ryzom/files/external_stlport.7z/download

I will assume that you install stlport in c:\external_stlport

Download and install all.

Set up everything

  • Microsoft Windows SDK settings

Copy c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd to c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd

Edit c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd

Edit the following lines and add your path to stlport :

SET "VCIncludes=c:\external_stlport\include\stlport;c:\external_stlport\include;%VCINSTALLDIR%INCLUDE"

SET "LIB=c:\external_stlport\lib;%VCLibraries%;%OSLibraries%;%FxTools%;%LIB%"

SET "LIB=c:\external_stlport\lib64;%VCLibraries%\amd64;%OSLibraries%\X64;%LIB%"

  • Qt settings

Edit the system variable PATH and add :

c:\Qt\4.7.4\bin

Create a systeme variable QTLIB with the following value :

c:\Qt\4.7.4\lib

If you're using Qt less than 4.8 (it's fixed in Qt 4.8+), you have to edit c:\Qt\4.7.4\src\3rdparty\clucene\src\CLucene\config\CompilerMsvc.h and comment 4 lines as following :

//#if (_MSC_VER < 1310)

#define CL_NS_HASHING(func) std::func //the namespace is different on VC 7.0

//#else

// #define CL_NS_HASHING(func) stdext::func

//#endif

Build

  • Build qmake with stl (not stlport)

Open a MSDOS console

Go to Qt folder :

cd c:\Qt\4.7.4\

Load default SDK environment :

c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd

Configure Qt :

configure

As soon as qmake is built, stop the process with CTRL + C

  • Build qt lib with stlport

Open a MSDOS console

Go to Qt folder :

cd c:\Qt\4.7.4\

Load SDK environment with stlport :

c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd

Clean the previous config

nmake confclean

Configure Qt for stlport :

configure -no-qmake -no-qt3support -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -openssl -I c:\external_stlport\include\openssl -no-exceptions -no-rtti -no-style-cde -no-style-motif -no-style-cleanlooks -no-style-plastique

Replace c:\external_stlport\include\openssl with your own path in the command line.

Build all except qmake :

nmake

It takes hours to build the lib.

You will find a compact version of the result here : Downloads for Windows

Known issues

qt/4.7.4/src/corelib/global/qglobal.h (2391): error C2039: 'dynamic_cast_will_always_fail_because_rtti_is_disabled': is not a member of 'global namespace '

Edit Qt\4.7.4\src\corelib\global\qglobal.h and replace:

return T::dynamic_cast_will_always_fail_because_rtti_is_disabled;

with:

return 0;

qdeclarative.cpp (355): error C3861: 'isspace': identifier not found

Edit Qt\4.7.4\tools\linguist\lupdate\qdeclarative.cpp and the following include:

#include <cctype>

cppcodemarker.cpp (950): error C3861: 'isalpha': identifier not found

Edit Qt\4.7.4\tools\qdoc3\cppcodemarker.cpp and the following include:

#include <cctype>