QtLibStlportWindows

Version 17 (kervala, 12/16/2011 03:10 pm)

1 1 molator
h1. Howto build Qt lib with Stlport on Windows
2 1 molator
3 1 molator
Thank you to Kervala.
4 1 molator
5 1 molator
6 1 molator
For this howto, i will use the Windows XP folder Program Files.
7 1 molator
Replace it for Windows Vista or 7.
8 1 molator
9 1 molator
h2. What you need
10 1 molator
11 1 molator
* Microsoft Visual Studio C++ 2008 Express Editions with SP1
12 1 molator
> http://www.microsoft.com/downloads/details.aspx?FamilyID=f3fbb04e-92c2-4701-b4ba-92e26e408569&displaylang=en
13 1 molator
14 1 molator
Download vcsetup.exe
15 1 molator
16 1 molator
* Microsoft .NET Framework 4
17 1 molator
> http://www.microsoft.com/downloads/details.aspx?familyid=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en
18 1 molator
19 1 molator
* Microsoft Windows SDK
20 1 molator
> http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en
21 1 molator
22 1 molator
Working too with Windows XP SP2
23 1 molator
24 15 molator
* Qt lib source for Windows (VS2008)
25 14 molator
> http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip
26 1 molator
27 1 molator
* stlport (ryzom core external lib)
28 2 kervala
> https://sourceforge.net/projects/ryzom/files/external_stlport.7z/download
29 1 molator
30 13 molator
I will assume that you install stlport in c:\external_stlport
31 1 molator
32 1 molator
Download and install all.
33 1 molator
34 1 molator
35 1 molator
h2. Set up everything
36 1 molator
37 1 molator
* Microsoft Windows SDK settings
38 1 molator
39 1 molator
Copy c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd to c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd
40 1 molator
41 1 molator
Edit c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd
42 1 molator
43 1 molator
Edit the following lines and add your path to stlport :
44 13 molator
> SET "VCIncludes=c:\external_stlport\include\stlport;c:\external_stlport\include;%VCINSTALLDIR%INCLUDE"
45 1 molator
46 13 molator
> SET "LIB=c:\external_stlport\lib;%VCLibraries%;%OSLibraries%;%FxTools%;%LIB%"
47 1 molator
48 13 molator
> SET "LIB=c:\external_stlport\lib64;%VCLibraries%\amd64;%OSLibraries%\X64;%LIB%"
49 1 molator
50 1 molator
* Qt settings
51 1 molator
52 1 molator
Edit the system variable PATH and add :
53 14 molator
> c:\Qt\4.7.4\bin
54 1 molator
55 1 molator
Create a systeme variable QTLIB with the following value :
56 14 molator
> c:\Qt\4.7.4\lib
57 1 molator
58 17 kervala
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 :
59 1 molator
> //#if (_MSC_VER < 1310)
60 1 molator
61 1 molator
>     #define CL_NS_HASHING(func) std::func //the namespace is different on VC 7.0
62 1 molator
63 1 molator
> //#else
64 1 molator
65 1 molator
> //  #define CL_NS_HASHING(func) stdext::func
66 1 molator
67 1 molator
> //#endif
68 1 molator
69 1 molator
70 1 molator
h2. Build
71 1 molator
72 1 molator
* Build qmake with stl (not stlport)
73 1 molator
74 1 molator
Open a MSDOS console
75 1 molator
76 1 molator
Go to Qt folder :
77 14 molator
> cd c:\Qt\4.7.4\
78 1 molator
79 1 molator
Load default SDK environment :
80 1 molator
> c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd
81 1 molator
82 1 molator
Configure Qt :
83 1 molator
> configure
84 1 molator
85 3 molator
As soon as qmake is built, stop the process with CTRL + C
86 1 molator
87 1 molator
88 1 molator
* Build qt lib with stlport
89 1 molator
90 1 molator
Open a MSDOS console
91 1 molator
92 1 molator
Go to Qt folder :
93 14 molator
> cd c:\Qt\4.7.4\
94 1 molator
95 1 molator
Load SDK environment with stlport :
96 1 molator
> c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnvWithStlport.cmd
97 1 molator
98 10 molator
Clean the previous config
99 10 molator
> nmake confclean
100 10 molator
101 1 molator
Configure Qt for stlport :
102 13 molator
> 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
103 1 molator
104 13 molator
Replace c:\external_stlport\include\openssl with your own path in the command line.
105 1 molator
106 1 molator
Build all except qmake :
107 1 molator
> nmake
108 1 molator
109 1 molator
It takes hours to build the lib.
110 1 molator
111 13 molator
You will find a compact version of the result here :
112 13 molator
http://dev.ryzom.com/projects/ryzom/wiki/WindowsBinaries
113 13 molator
114 13 molator
h2. Known issues
115 13 molator
116 13 molator
> 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 '
117 13 molator
118 13 molator
Edit Qt\4.7.4\src\corelib\global\qglobal.h and replace:
119 13 molator
> return T::dynamic_cast_will_always_fail_because_rtti_is_disabled;
120 13 molator
121 13 molator
with:
122 13 molator
> return 0;
123 13 molator
124 13 molator
125 13 molator
> qdeclarative.cpp (355): error C3861: 'isspace': identifier not found
126 16 molator
Edit Qt\4.7.4\tools\linguist\lupdate\qdeclarative.cpp and the following include:
127 16 molator
> #include <cctype>
128 16 molator
129 13 molator
> cppcodemarker.cpp (950): error C3861: 'isalpha': identifier not found
130 13 molator
131 13 molator
Edit Qt\4.7.4\tools\qdoc3\cppcodemarker.cpp and the following include:
132 13 molator
> #include <cctype>
133 1 molator
134 1 molator
That's all folks!