How to compile with Cygwin?
Moderator: OpenTTD Developers
How to compile with Cygwin?
Well... I searched among the whole forum but I can't find a solution for my compiling problems. I've got experience with PHP, QBasic (haha) and such languages but they don't need to be compiled.
Well, this is what I did.
- Installed TortoiseSVn and Cygwin
- Checkout (SVN) to C:\OpenTTD\
- Opened Cygwin
- cd /cygdrive/c/openttd
And there is where it goes wrong. I type "make" and the bash (??) returns "bash: make: file not found". So I really don't know how to compile the game.
So can anybody tell me how to compile this nice game?
Well, this is what I did.
- Installed TortoiseSVn and Cygwin
- Checkout (SVN) to C:\OpenTTD\
- Opened Cygwin
- cd /cygdrive/c/openttd
And there is where it goes wrong. I type "make" and the bash (??) returns "bash: make: file not found". So I really don't know how to compile the game.
So can anybody tell me how to compile this nice game?
Thank you, that helped me
. But you also have to install the 'make' library else it won't work neiter. Now I got my enhanced version working (also thank to this thread).
There are 2 things left I can't fix myself:
1) The MIDI won't play, I try to start it from the jukebox but it just doesn't start!!
2) Is there a way to include cygwin1.dll and cygz.dll into the .exe executable?
Much thanks in advantage!
--Update--:
Some buttons didn't want to work at first dry, so I downloaded the whole "devel" tools which fixed the problems
. But still need those 2 problems fixed please.

There are 2 things left I can't fix myself:
1) The MIDI won't play, I try to start it from the jukebox but it just doesn't start!!
2) Is there a way to include cygwin1.dll and cygz.dll into the .exe executable?
Much thanks in advantage!
--Update--:
Some buttons didn't want to work at first dry, so I downloaded the whole "devel" tools which fixed the problems

Okey, this is what I did:
This crashed at network.c (bunches of errors and warnings). So I removed WITH_NETWORK=1:
This also crashed at w32dm2.cpp so I removed WITH_DIRECTMUSIC=1:
1. And finally... that seems to work
. Even still I can't get my music to work and those .dll-files aren't included too
. And the exit message says Unix instead of Windows. Is there anyway to fix this problems?
2. With removing the WITH_NETWORK=1 networkplaying is disabled, how can I compile OTTD wíth network support?
Error messages when I compile with networksupport:
Line 161 reads: As far as my knowledge goes (that musn't be really far
) this would be wrong IMO.
Code: Select all
$ cd /cygdrive/c/openttd
$ make WIN32=1 WITH_PNG=1 CYGWIN=1 WITH_DIRECTMUSIC=1 WITH_NETWORK=1
Code: Select all
$ make WIN32=1 WITH_PNG=1 CYGWIN=1 WITH_DIRECTMUSIC=1
Code: Select all
$ make WIN32=1 WITH_PNG=1 CYGWIN=1


2. With removing the WITH_NETWORK=1 networkplaying is disabled, how can I compile OTTD wíth network support?
Error messages when I compile with networksupport:
Code: Select all
rnetwork.c:161: error: syntax error before "_listensocket"
network.c:161: warning: type defaults to `int' in declaration of `_listensocket'
network.c:161: warning: data defenition has no type or storage class
network.c: In function `NetworkSendCommand':
network.c:301: error: `INVALID_SOCKET' undeclared (first use in this function)
etc...
Code: Select all
static SOCKET _listensocket;

After playing around.
Today I started testing again, but now the game generates this stackdump:
Is this due to the latest source I've downloaded or am I still doing things wrong?
I think it has to do with this error when I try to compile:
Code: Select all
Exception: STATUS_ACCESS_VIOLATION at eip=004A194A
eax=0000001A ebx=6111B310 ecx=0000001A edx=FFFFFFFF esi=00000000 edi=6111B310
ebp=0022EEB8 esp=0022EE60 program=C:\Program Files\OpenTTD\ttd.exe, pid 2404, thread main
cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023
Stack trace:
Frame Function Args
0022EEB8 004A194A (77E46CA5, 00240000, 00000000, 002468E0)
0022EFE8 004A1ABE (00400000, 00000000, 0024236B, 00000001)
0022F058 004A271E (00000001, 10040168, 100400A8, 00000001)
0022F0A8 61005F54 (0022F0C0, 002305DC, 00000000, 0022F108)
0022FF88 6100616B (00000000, 00000000, 00000000, 00000000)
End of stack trace
I think it has to do with this error when I try to compile:
Code: Select all
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bind/lid: warning: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000
normally when a compiler complains about missing symbols it is because you're not linking all required libraries...
I have no experience with cygwin, however
I have no experience with cygwin, however

Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
ms visual c++Bouke wrote:Very weird, I'm just using the makefile, so it isn't me who has to include the libraries (I think?).
With what tool do you compile with then? Since I really want to compile OpenTTD and to start coding C..
but that costs money so might be hard to get, the free .net development tools have a compiler too, but I don't know if you can compile ottd with it.
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
I did download the free 2003 .net command line. The command to compile is cl. Cl /? brings up this list of options. Do you think we could compile OpenTTD with this command. If so, how?Korenn wrote:ms visual c++Bouke wrote:Very weird, I'm just using the makefile, so it isn't me who has to include the libraries (I think?).
With what tool do you compile with then? Since I really want to compile OpenTTD and to start coding C..
but that costs money so might be hard to get, the free .net development tools have a compiler too, but I don't know if you can compile ottd with it.

-
- Tycoon
- Posts: 14275
- Joined: 09 Jan 2003 08:37
After all compiling with Cygwin isn't as easy as typing "make". So I decided to try Microsoft Visual 6 C++. I've managed to create a "Debug" build, but I can't create a "Release" build since I can't create a libpng.lib. Can somebody help me here? I've downloaded the whole libpng package and also the zlib package.
My best guess is that I have to put the zlib in c:\libraries\zlib and pnglib in c:\libraries\lpng125. libpng includes also a MV6 "workspace". Then I select that I only want ZLib Lib and PNG Lib in the Build menu. Then it tries to build libpng first, that fails because zlib lib hasn't been created yet. But afterwards it tries to build the zlib lip, that's where it throws me this error: I've googled whole night long but couldn't find an solution. Can somebody help me please?
(We're nearing target -> OpenTTD Release Build instead of Debug Build
My best guess is that I have to put the zlib in c:\libraries\zlib and pnglib in c:\libraries\lpng125. libpng includes also a MV6 "workspace". Then I select that I only want ZLib Lib and PNG Lib in the Build menu. Then it tries to build libpng first, that fails because zlib lib hasn't been created yet. But afterwards it tries to build the zlib lip, that's where it throws me this error:
Code: Select all
--------------------Configuration: zlib - Win32 LIB--------------------
Compiling...
gzio.c
Compiling...
adler32.c
compress.c
crc32.c
deflate.c
trees.c
uncompr.c
Generating Code...
Compiling...
infblock.c
fatal error C1083: Cannot open source file: 'C:\Libraries\zlib\infblock.c': No such file or directory
infcodes.c
fatal error C1083: Cannot open source file: 'C:\Libraries\zlib\infcodes.c': No such file or directory
inffast.c
inflate.c
inftrees.c
infutil.c
fatal error C1083: Cannot open source file: 'C:\Libraries\zlib\infutil.c': No such file or directory
zutil.c
Generating Code...
Error executing cl.exe.
zlib.lib - 3 error(s), 0 warning(s)
(We're nearing target -> OpenTTD Release Build instead of Debug Build

After downloading the usefull packet from http://sourceforge.net/projects/openttd/ it all worked, no errors
. Another thing... why can't OpenTTD use DirectX 9 instead of the really old DirectX7? And why can't it use the newest versions of zlib and libpng?
Kind regards.

Kind regards.
Who is online
Users browsing this forum: No registered users and 4 guests