Page 2 of 3

Posted: 16 Mar 2004 14:53
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.

Posted: 16 Mar 2004 16:29
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

Posted: 16 Mar 2004 18:04
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:

Posted: 17 Mar 2004 16:18
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?

Posted: 17 Mar 2004 19:49
by Eirik
will there be a precompiled package for linux?
i'm not able to compile it, get some sdl-config error

Posted: 17 Mar 2004 19:57
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.

Posted: 17 Mar 2004 20:33
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 :?:

Posted: 17 Mar 2004 22:14
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

Posted: 17 Mar 2004 23:54
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...

Posted: 18 Mar 2004 21:07
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.

Posted: 18 Mar 2004 21:45
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.

Posted: 18 Mar 2004 22:45
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...

Posted: 18 Mar 2004 22:47
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?

Posted: 19 Mar 2004 00:29
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...

Posted: 20 Mar 2004 22:41
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

Posted: 21 Mar 2004 01:39
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?

Posted: 21 Mar 2004 10:14
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).

Posted: 21 Mar 2004 12:35
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.

Posted: 21 Mar 2004 12:51
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 :(

Posted: 21 Mar 2004 13:16
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...