OpenTTD on Linux

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

OpenTTD on Linux

Post by Saskia »

For those who are interested and using Linux: I tried to compile it. Luckily, most work was done to get OpenTTD platform-independent, i.e. #ifdefs. After correcting the Makefile (removing unavailable files from it), and a minor bugfix, it compiled successfully. But then the linker came ... seems that an .c-file for OS specific routines for Linux doesn't exist :cry: For Windows it's win32.c ...

To Ludde, when do you think have an linux.c ready and working? :D
User avatar
orudge
Administrator
Administrator
Posts: 25138
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Can sdl.c not be coaxed to work?
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

SDL causes no problems so far ... the problem is that win32.c also encapsulates things like file I/O, and so there's no file I/O for Linux at the moment ... :(
User avatar
GoneWacko
Tycoon
Tycoon
Posts: 8680
Joined: 10 Jul 2002 15:08
Location: Enschede, The Netherlands
Contact:

Post by GoneWacko »

if anyone ever gets it working, please make a tarball of the compiled binary...

I don't really know enough about compiling/linux to do it myself :roll:
Last edited by GoneWacko on 07 Mar 2004 18:44, edited 1 time in total.
GoneWacko. Making [url=irc://irc.oftc.net/tycoon]#tycoon[/url] sexy and exciting since 1784.
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

Compiling with Linux is easier than installing with Windows :lol: When you have the tarball (when it's finished with linux.c :wink:), just cd into the directory and type "make install". That's all :)
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Post by ChrisCF »

Surely it would be better to put stuff like file I/O etc. into one file, and then get *that* to include the platform-specific bits.

Which platform-specific functions are in use there anyway?
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

Ehm, wait a moment ... there are functions for palette, cursor, keys, windows, filesystem things, sound and exception handling.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Ehm, wait a moment ... there are functions for palette, cursor, keys, windows, filesystem things, sound and exception handling.
I think that is possible to make cross platform is the right libraries are used. The question now: what library makes it possible :?:
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

It already is.. Look at the 'new release' thread by Ludde for a new release which should work on *nix
Protect the Banana
User avatar
Slace
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 15 Mar 2004 10:20

Post by Slace »

so does OTTD work under linux? I really want to be able to use it on my laptop, which runs linux and I don't wanna mess around using WINE or anything
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Yup it works fine here. The 0.1 release does anyway, without any music. The latest release should have a working music-system. I'm gonna try that right now :)
Protect the Banana
User avatar
GoneWacko
Tycoon
Tycoon
Posts: 8680
Joined: 10 Jul 2002 15:08
Location: Enschede, The Netherlands
Contact:

Post by GoneWacko »

bah i'll just try
But i'll prolly never get it to work -_-
GoneWacko. Making [url=irc://irc.oftc.net/tycoon]#tycoon[/url] sexy and exciting since 1784.
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

What doesn't work - music or OTTD?
User avatar
GoneWacko
Tycoon
Tycoon
Posts: 8680
Joined: 10 Jul 2002 15:08
Location: Enschede, The Netherlands
Contact:

Post by GoneWacko »

Well I just tried it again this afternoon.

I did exactly what you told me to. I replaced sdl11 with sdl in the make file, and all that. First it gave me errors about GCC.

Then I reinstalled all GCC stuff I could find in YaST.
typed make again.
That wored. No more GCC errors.
But now it gives a hole load of SDL errors about a header file (SDL.h and SDL-Threads.h or something) being missing. I tried just about everything. Downloading the source of SDL and placing the .h file in the openttd dir, in some subdirectories, etc.

Nothing worked :(
GoneWacko. Making [url=irc://irc.oftc.net/tycoon]#tycoon[/url] sexy and exciting since 1784.
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

*wah* never reinstall GCC, it could end up dangerous ...
And which version do you want to compile? My last one is the 0.1 with unix.c (the second release here), because I have no SVN client ... You need the SDL development headers*, if you don't have them yet. Also try

Code: Select all

ls /usr/bin/sdl*config
on the shell. If no files are found, you don't have the headers. If a file was found, you need to write it in the Makefile, instead of sdl-config or sdl11-config.

*) this is not the same as downloading the SDL source. You may try to make and install SDL, if you don't get a package with development headers from your distribution.
User avatar
GoneWacko
Tycoon
Tycoon
Posts: 8680
Joined: 10 Jul 2002 15:08
Location: Enschede, The Netherlands
Contact:

Post by GoneWacko »

hmm. Well I am famous for messing up my system. (Prencher says)

Anyways, why would it be dangerous to reinstall GCC. If it would be dangerous, then why would it be in YaST ? :?

Whatever.
I'll try it again when I get home (at school now)
GoneWacko. Making [url=irc://irc.oftc.net/tycoon]#tycoon[/url] sexy and exciting since 1784.
User avatar
Slace
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 15 Mar 2004 10:20

Post by Slace »

since I'm confused on how to get it working does someone wanna point me to a guide of what to do, or post a version i can unrar and use?
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

http://www.pointpro.nl/ttd.tgz

That's the binaries and other stuff you'll need.
The only thing you need to do is everything in the gm/ folder of your TTDX for Windows installation to the gm/ folder created after you unpack this file, and copy sample.cat and *.grf from your TTDX for Windows installation.

I would like to add 'm for you but I'm not gonna risk all the legal stuff, so you'll have to do that yourself.
Protect the Banana
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

GoneWacko wrote: Anyways, why would it be dangerous to reinstall GCC. If it would be dangerous, then why would it be in YaST ? :?
Because GCC is a bit complicated and sensitive for different versions of it's main package, the compiler modules, the library, and so on. And then it's very difficult to find the source of your problems, because the compiler messages get microsoftified: they don't point to the right problem - the wrong library for example! :wink: Anyway, the kernel is in YaST too, or isn't it? :wink: I don't have SuSE, I hate it, it's like Windows ... it don't even lets you set the rights of your files, or edit something in /etc!

:idea: For the future: you never need to reinstall GCC. The worst thing is, that you need to update some special libraries, because they are outdated on your system. :idea:
User avatar
Hajo
Route Supervisor
Route Supervisor
Posts: 420
Joined: 17 Jan 2003 09:52

Post by Hajo »

It isn't that bad - I compiled my own gcc versions in the past, and often even had different gcc versions installed in parallel.

It worked.

But I must admit, I don't have experience with the latest gcc versions, maybe it became more troublesome nowadays?
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 33 guests