author | rubidium |
Wed, 03 Jan 2007 08:56:09 +0000 | |
branch | custombridgeheads |
changeset 5645 | 72ebd9e4cd64 |
parent 5592 | fd60d4ecc921 |
child 6877 | 889301acc299 |
permissions | -rw-r--r-- |
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
1 |
Compiling OpenTTD using Microsoft Visual C++ |
5645 | 2 |
January 2, 2007 |
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
3 |
-------------------------------------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
4 |
PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!! |
844
f1cae32ae8af
(svn r1325) -Fixed eol-style properties on new files. Please before adding a new file to svn use: "svn propset svn:eol-style native <filename's>"!!
darkvater
parents:
614
diff
changeset
|
5 |
|
5645 | 6 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
7 |
SUPPORTED MSVC COMPILERS |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
8 |
------------------------ |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
9 |
OpenTTD includes projects for MSVC 2003.NET and MSVC 2005.NET. Both will |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
10 |
compile out of the box, providing you have the required libraries/headers; |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
11 |
which ones, see below. There is no support for VS6, you are therefore |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
12 |
strongly encouraged to either upgrade to MSVC 2005 Express (free) or use GCC. |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
13 |
MSVC 2002 probably works as well, but it has not been tested. |
844
f1cae32ae8af
(svn r1325) -Fixed eol-style properties on new files. Please before adding a new file to svn use: "svn propset svn:eol-style native <filename's>"!!
darkvater
parents:
614
diff
changeset
|
14 |
|
5645 | 15 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
16 |
1) REQUIRED FILES |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
17 |
----------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
18 |
You might already have some of the files already installed, so check before |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
19 |
downloading; mostly because the DirectX SDK and Platform SDK are about |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
20 |
500MB each. |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
21 |
Download the following files: |
844
f1cae32ae8af
(svn r1325) -Fixed eol-style properties on new files. Please before adding a new file to svn use: "svn propset svn:eol-style native <filename's>"!!
darkvater
parents:
614
diff
changeset
|
22 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
23 |
* openttd-useful.zip (http://sf.net/project/showfiles.php?group_id=103924&package_id=114307) |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
24 |
* DirectX 8.1 SDK (http://neuron.tuke.sk/~mizanin/eng/Dx81sdk-include-lib.rar) (or alternatively the latest DirectX SDK from Microsoft) |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
25 |
* MS Windows Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en) |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
26 |
* afxres.h (http://www-d0.fnal.gov/d0dist/dist/packages/d0ve/devel/windows/AFXRES.H) |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
27 |
|
2771
53c0f60949b0
(svn r3318) - Codechange: [FS#27] MSVC projectfile & documentation update (bociusz)
Darkvater
parents:
940
diff
changeset
|
28 |
...and of course the newest source from svn://svn.openttd.org/trunk |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
29 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
30 |
You need an SVN-client to download the source from subversion: |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
31 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
32 |
* CLI Subversion (http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91) |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
33 |
* GUI TortoiseSVN (http://tortoisesvn.tigris.org/download.html) |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
34 |
|
5645 | 35 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
36 |
2) INCLUDES AND LIBRARIES |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
37 |
------------------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
38 |
Put the newly downloaded files in the VC lib\ and include\ directories; where |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
39 |
"C:\Program Files\Microsoft Visual Studio 8\VC" is your location of Visual C. |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
40 |
If you are compiling for an x64 system, use the include\ and lib\ directories |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
41 |
from the win64/ folder. |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
42 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
43 |
* openttd-useful.zip\include\* |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
44 |
* afxresh.h |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
45 |
to > C:\Program Files\Microsoft Visual Studio 8\VC\Include |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
46 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
47 |
* openttd-useful.zip\lib\* |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
48 |
to > C:\Program Files\Microsoft Visual Studio 8\VC\Lib |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
49 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
50 |
Custom directories might be recommended, check 2.2) |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
51 |
|
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
52 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
53 |
2.1) INCLUDES AND LIBRARIES - DIRECTX/PLATFORM SDK |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
54 |
-------------------------------------------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
55 |
Basically the same procedure as with the useful zip file, providing |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
56 |
you are not using the Microsoft installer. Put the include files in the |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
57 |
include\ directory and the library files to the Lib\ directory. |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
58 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
59 |
It is recommended to use custom directories so you don't overwrite any |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
60 |
default header or library files. |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
61 |
|
5645 | 62 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
63 |
2.2) CUSTOM DIRECTORIES |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
64 |
----------------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
65 |
If you have put the above include and/or library files into custom folders, |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
66 |
MSVC will not find them by default. You need to add these paths to VC through: |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
67 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
68 |
Tools > Options > Projects and Solutions > VC++ Directories > show directories for |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
69 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
70 |
* Include files: Add the DirectX/Platform SDK include dir you've created |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
71 |
* Library files: Add the path to the SDK custom lib dir |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
72 |
|
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
73 |
NOTE: make sure that the directory for the DirectX SDK is the first one in the |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
74 |
list, above all others, otherwise compilation will most likely fail!! |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
75 |
|
5645 | 76 |
|
77 |
2.3) DEBUGGING - WORKING DIRECTORY (MSVC 2003 ONLY!) |
|
78 |
---------------------------------------------------- |
|
79 |
The very first time you check out and compile OpenTTD with Visual Studio 2003, running |
|
80 |
the binary will complain about missing files. You need to go into and change a setting |
|
81 |
||
82 |
OpenTTD > Project > Properties > Configuration (All Configurations) > ... |
|
83 |
Configuration Properties > Debugging > |
|
84 |
||
85 |
* Working Directory: ..\bin |
|
86 |
||
87 |
VS 2005 works out of the box because Microsoft allowed a user to supply a humanly- |
|
88 |
readable defaults file (openttd_vs80.vcproj.user), whereas 2003 is braindead. |
|
89 |
||
90 |
||
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
91 |
3) TTD GRAPHICS FILES |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
92 |
--------------------- |
5645 | 93 |
Copy the following files from Transport Tycoon Deluxe to the bin/data folder |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
94 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
95 |
* sample.cat |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
96 |
* trg1r.grf |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
97 |
* trgcr.grf |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
98 |
* trghr.grf |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
99 |
* trgir.grf |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
100 |
* trgtr.grf |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
101 |
|
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
102 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
103 |
4) COMPILING |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
104 |
------------ |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
105 |
Open trunk/openttd[_vs80].sln |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
106 |
Set the build mode to 'Release' in |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
107 |
Build > Configuration manager > Active solution configuration > select "Release" |
940
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
108 |
Compile... |
24e6412a2214
(svn r1428) Compiling with MSVC6 documentation update (from the wiki) [Bociusz]
miham
parents:
844
diff
changeset
|
109 |
|
5645 | 110 |
If everything works well the binary should be in trunk/objs/[Win32]/Release/openttd.exe |
111 |
||
2771
53c0f60949b0
(svn r3318) - Codechange: [FS#27] MSVC projectfile & documentation update (bociusz)
Darkvater
parents:
940
diff
changeset
|
112 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
113 |
5) EDITING, CHANGING SOURCE CODE |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
114 |
-------------------------------- |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
115 |
Set the build mode (back to) 'Debug' |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
116 |
Change the startup project to openttd by right-clicking the 'openttd' project |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
117 |
in the Solution Explorer and selecting 'Set as Startup Project'. The 'openttd' |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
118 |
project should now show up bold instead of 'strgen'. |
844
f1cae32ae8af
(svn r1325) -Fixed eol-style properties on new files. Please before adding a new file to svn use: "svn propset svn:eol-style native <filename's>"!!
darkvater
parents:
614
diff
changeset
|
119 |
|
5645 | 120 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
121 |
6) PROBLEMS? |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
122 |
------------ |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
123 |
If compilation fails, double-check that you are using the latest SVN (!) |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
124 |
source. If it still doesn't work, check in on IRC (irc://irc.oftc.net/openttd), |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
125 |
to ask about reasons; or just wait. The problem will most likely solve itself |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
126 |
within a few days as the problem is noticed and fixed. |
844
f1cae32ae8af
(svn r1325) -Fixed eol-style properties on new files. Please before adding a new file to svn use: "svn propset svn:eol-style native <filename's>"!!
darkvater
parents:
614
diff
changeset
|
127 |
|
5592
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
128 |
An up-to-date version of this README can be found on the wiki: |
fd60d4ecc921
(svn r7608) [cbh] - Merge with trunk r7593:7607 because I need 7607 here
celestar
parents:
5355
diff
changeset
|
129 |
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress |