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
GoneWacko
Tycoon
Tycoon
Posts: 8680
Joined: 10 Jul 2002 15:08
Location: Enschede, The Netherlands
Contact:

Post by GoneWacko »

okay lesson learned :)

May I ask you what distro you have then?
I'm moving to Debian Sarge this weekend. If everything goes as planned, that is.
GoneWacko. Making [url=irc://irc.oftc.net/tycoon]#tycoon[/url] sexy and exciting since 1784.
User avatar
Hajo
Route Supervisor
Route Supervisor
Posts: 420
Joined: 17 Jan 2003 09:52

Post by Hajo »

I'm using SuSE Linux, my most up to date installation is 8.1

Most recent gcc version that I've had compiled is 2.95.2 on SuSE 7.0
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

@Hajo: I've heared of users who had problems, because GCC 2.95 tried to use the standard library of GCC 3 :?

@Wacko: I'm using Debian for two years, after some configuration you won't miss it :wink:
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

When I compile, I get this
Compiling win32.c (76 errors)
win32.c:6: header file 'windows.h' not found
win32.c:7: header file 'mmsystem.h' not found
win32.c:9: header file 'winnt.h' not found

How did you manage to avoid the windows only files?
Eirik
Engineer
Engineer
Posts: 1
Joined: 17 Mar 2004 19:36

Post by Eirik »

will there be a precompiled package for linux?
i'm not able to compile it, get some sdl-config error
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Look at my previous post in this thread, it containts a tgz file with Linux binaries in it.

You can easliy solve the sdl-config error yourself by editting 'Makefile' and replacing every occurence of sdl11-config with sdl-config. That's all.
Protect the Banana
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

MadEgg wrote:Look at my previous post in this thread, it containts a tgz file with Linux binaries in it.
That doesn't fix my problem. You properly compiled to a i386. I'm trying to port it to mac, and as we all know, they aren't based on x86 cpus.

What should I do with win32.c, when I'm not using windows :?:
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

Bjarni wrote:When I compile, I get this
Compiling win32.c (76 errors)
win32.c:6: header file 'windows.h' not found
win32.c:7: header file 'mmsystem.h' not found
win32.c:9: header file 'winnt.h' not found

How did you manage to avoid the windows only files?
Are you really using Linux? Generally the Linux include files define a value to show the #ifdefs that you're using it. If it doesn't work, look for these #ifdefs and hardcode to linux. Also remove the lines that include win32.c
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Bjarni wrote:
MadEgg wrote:Look at my previous post in this thread, it containts a tgz file with Linux binaries in it.
That doesn't fix my problem. You properly compiled to a i386. I'm trying to port it to mac, and as we all know, they aren't based on x86 cpus.

What should I do with win32.c, when I'm not using windows :?:
I was actually replying to Eirik with that post.

As for your problem, I wouldn't know why that is happening. Are you using the Makefile to build it? That should use the unix.c instead of win32.c...
Protect the Banana
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Since the makefile works for the rest of you, I tried it again. It still doesn't work though. When I try it, I get this

0x50a46af7:/volumes/hd120/openttd/openttd bjarni$ ./makefile
./makefile: line 80: all: command not found
./makefile: line 1: ttd_sources:.c=.o: command not found
./makefile: line 123: ttd: command not found
./makefile: line 1: C_BUILD: command not found
./makefile: line 124: $^: command not found
./makefile: line 1: ttd_sources:.c=.d: command not found
./makefile: line 125: include: command not found
./makefile: line 130: clean: command not found
./makefile: line 133: .PHONY: command not found
CC: no input files
./makefile: line 1: CFLAGS: command not found
./makefile: line 153: ?C_OBJ_BUILD=: command not found
./makefile: line 1: CFLAGS: command not found
CC: no input files
./makefile: line 154: -o: command not found
./makefile: line 160: fg: no job control
./makefile: line 161: syntax error near unexpected token `newline'
./makefile: line 161: ` $(C_OBJ_BUILD) $<'

The first error is the line
all : TTD
I can't fix it since I have no idea of what it does :oops:
Do anybody know how to fix this?
Do you know any really good links for shell scripting. I'm not a complete newbie, but I still have some important things to learn.
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Ghehe.. You're not supposed to execute the Makefile directly.

The makefile containts information on what the 'make' command should do.
Just entering:

Code: Select all

make
should work. That reads the Makefile and then knows how to compile.

Something you should fix first before it will compile at all on Unix systems is open the unix.c file and add the line:

Code: Select all

#include <sys/statfs.h>
to the top after the

Code: Select all

#include <sys/stat.h>
line.
Protect the Banana
User avatar
petteyg359
Engineer
Engineer
Posts: 5
Joined: 06 Mar 2004 20:58
Contact:

Post by petteyg359 »

Saskia wrote:
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!
If you don't like it because you can't do that, then why not just change settings so that you can? You talk like you're a Linux pro... Log in as root and change the permissions so that whatever your normal log-on is can access those directories/files... Pretty simple to do...
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Now it compiles and it even starts. That is if I set the videodriver to null :(
It works because if I write -g (start game) and waits, I can hear the new year sound :)
I feel so close

Now the (hopefullt only) problem remains:
If I use the SDL video driver, I get this:
2004-03-18 23:37:09.235 ttd[2666] *** _NSAutoreleaseNoPool(): Object 0x134a340 of class NSCFString autoreleased with no pool in place - just leaking
2004-03-18 23:37:09.237 ttd[2666] *** _NSAutoreleaseNoPool(): Object 0x1338e80 of class NSException autoreleased with no pool in place - just leaking
2004-03-18 23:37:09.239 ttd[2666] *** Uncaught exception: <NSInternalInconsistencyException> Error (1002) creating CGSWindow
Trace/BPT trap

I have SDL 1.2.7

Are there any SDL expert out there

any suggestions?
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

petteyg359 wrote: If you don't like it because you can't do that, then why not just change settings so that you can? You talk like you're a Linux pro... Log in as root and change the permissions so that whatever your normal log-on is can access those directories/files... Pretty simple to do...
This is going quite offtopic but that's about one of the worst things you can do. The reason normal users can't do that is so that you(or any virus-like program) can't mess the whole system up, in the worst case only your own home-directory...
Protect the Banana
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

I started all over and downloaded the new code, but I still have problems :cry:

When I write make, it compiles and give this error:

gcc -g -Wall -Wno-multichar `sdl-config --cflags` -DUNIX -DWITH_SDL -c unix.c
unix.c:10:25: sys/statvfs.h: No such file or directory
unix.c: In function `FiosGetDescText':
unix.c:143: error: storage size of `s' isn't known
unix.c:145: warning: implicit declaration of function `statvfs'
unix.c:143: warning: unused variable `s'

Help. Please. Really want this to work
User avatar
Slace
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 15 Mar 2004 10:20

Post by Slace »

I haven't been able to open my saved games from using the patch in windows (ie, TTDX with the patch) under linux OTTD, the program seg faults.

is OTTD meant to be able to open games saved with the patch or not?
User avatar
orudge
Administrator
Administrator
Posts: 25137
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

No, patched games won't load (well, it depends on the features you use really, but if you use morevehicles, the game probably won't load).
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Bjarni wrote:I started all over and downloaded the new code, but I still have problems :cry:

When I write make, it compiles and give this error:

gcc -g -Wall -Wno-multichar `sdl-config --cflags` -DUNIX -DWITH_SDL -c unix.c
unix.c:10:25: sys/statvfs.h: No such file or directory
unix.c: In function `FiosGetDescText':
unix.c:143: error: storage size of `s' isn't known
unix.c:145: warning: implicit declaration of function `statvfs'
unix.c:143: warning: unused variable `s'

Help. Please. Really want this to work
You could open unix.c and replace every occurence of statvfs with statfs.(so also change the #include <sys/statvfs.h> to #include <sys/statfs.h>.

I think you should have that file and it works equally well.
Protect the Banana
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

I tried that, but I still get the same error. That is, it says sys/statfs.h instead of sys/statvfs.h
so that didn't work :(
MadEgg
Engineer
Engineer
Posts: 72
Joined: 08 Mar 2004 12:51
Location: Netherlands
Contact:

Post by MadEgg »

Have you searched for the statfs.h or statvfs.h file? Something like:

Code: Select all

find /usr/include -iname 'statfs.h'
or

Code: Select all

locate statfs.h
should work. The statfs.h and statvfs.h files come with glibc, so if you've got glibc installed you should have those headerfiles...
Protect the Banana
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 35 guests