I'm not sure if people need this topic but I've compiled oTTD on windows with VS.Net and would like to share my experiences with you. In the repository there is already a Solution file for VS.Net 2003 but if you want PNG, or ZLIB support, you will have to do some actions on your own.
I'll go point by point.
if you don't have SDL download it from http://www.libsdl.org/download-1.2.php then read the SDL setup guide http://pgdc.purdue.org/sdltutorial/sdl_setup.html. You don't need SDL for windows, but if you want it, you can download and install it. If you feel you don't want to, which is most likely, the remove WITH_SDL from the release build configuration
Put all the header files (.h) into your Include directory, if you'd like to have zlib/png support for future projects. In most cases it is C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include
You should put the 2 lib files where the project is looking for them, in your main directory (where all the .c files and solution file is)
Put the .grf files to the data/ directory, together with the copied trgr*.grf files, sample.cat, etc, etc,.
Now, set the TTD as "Set as Startup Project", compile and enjoy
Note*: I had some problems with the libraries included in the useful package. If you have too, you might try the ones below. I'm using those too, and it works fine.
Last edited by Darkvater on 30 Jun 2004 12:47, edited 4 times in total.
TrueLight:"Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?" <@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Could someone help me with that? Also it might be a good idea to include the compilation hints with the source to make it easier for people to get into OpenTTD coding.
I'll be blunt. Everything needed to compile openttd is included in the source tree; if you don't know how to use visual studio projects, makefiles or jamfiles, don't code. It may be harsh, but you should learn to use the tools before trying to contribute.
The lng files must be generated using strgen from the txt files. This is done automatically with the jamfile and the visual studio projects -- just copy the .lng files from the lang folder to your openttd directory.
Wow, you really were blunt. But thanks anyway, you helped me getting it to run. Was I supposed to smell that the .lng file would be dumped into a different folder? Things like that are why I think that compilation hints wouldn't be a bad idea.
My original post was for the initial release of ottd, a lot has changed since then, and it's not really valid anymore.
You indeed have to copy the generated .lng files from the 'lang' directory to the directory where you have all the graphic files, sample.cat, etc. Then if you run ottd, it will run just fine.
TrueLight:"Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?" <@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Every time I try to compile with VC++ .net, I get the following errors. I think this has to due with Zlib, but can't figure out what is wrong,
ttd error LNK2019: unresolved external symbol _inflateInit_ referenced in function _InitReadZlib
ttd error LNK2019: unresolved external symbol _inflate referenced in function _ReadZlib
ttd error LNK2019: unresolved external symbol _inflateEnd referenced in function _UninitReadZlib
ttd error LNK2019: unresolved external symbol _deflateInit_ referenced in function _InitWriteZlib
ttd error LNK2019: unresolved external symbol _deflate referenced in function _WriteZlibLoop
ttd error LNK2019: unresolved external symbol _deflateEnd referenced in function _UninitWriteZlib
You should download the "usefull" package from sourceforge, that contains the supported zlib files. It also includes the pnglib files needed to compile. *.lib files should go into the lib/bin directory of your compiler. And also make sure you put the other files into a seperate directory (like /includes) then include this directory in the "directory includes" thing in options of VS.NET.
TrueLight:"Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?" <@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
I have added the Lib directory to the VS.NET lib entries, pointing to the location of my zlib.lib and zlibstat.lib
You do know that this is not what I said? Anyways, I too had some problems with the libraries. Especially zlib. I attached mine at the startpost, those always work for me.
TrueLight:"Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?" <@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
fatal error C1083: Cannot open include file: 'dmksctrl.h': No such file or directory
It works if I undef WIN32_ENABLE_DIRECT_MUSIC_SUPPORT (but then I get no in game sound)
I can't find this file anywhere on my system, what should I install to get this to run?
Lord of the Pigs
I think you need to download the DirectX SDK.
Altough I'm not sure cause I am using VS.NET and it must already be included in the .NET Framework.
TrueLight:"Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?" <@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."