Page 1 of 1

Problems with Compiling

Posted: 27 Jul 2008 15:30
by ChefKoch
I have some Files that cant be found when Im building ottd.. I attached the Logfile.

Anyone got an idea how to fix this? I followed the manual on the wiki.

Help is much appreciated
regards
ChefKoch

Re: Problems with Compiling

Posted: 27 Jul 2008 16:50
by DaleStan
ChefKoch wrote:I attached the Logfile.
Unfortunately, it seems that didn't work. Can you try again, please?

Re: Problems with Compiling

Posted: 27 Jul 2008 19:45
by ChefKoch
Thanx A LOT for your quick reply already, file should work now just change the ending to htm to view it properly

Re: Problems with Compiling

Posted: 27 Jul 2008 22:17
by glx
Ok, it seems you are using MSVC8, but you don't have the platform SDK.
Follow instructions on http://wiki.openttd.org/index.php/Micro ... s_Editions and it should compile fine.

Re: Problems with Compiling

Posted: 28 Jul 2008 05:28
by ChefKoch
I followed that guide 1:1, the only thing I could not do was:

Only a few changes are required to use the Platform SDK with Visual C++ 2005 Express. Please follow steps 3, 4 and maybe 5 of the guide from Microsoft

because the Link is dead..

Does anyone know what thouse steps were?

Edit: nm, now the link works.

Re: Problems with Compiling

Posted: 28 Jul 2008 06:29
by Mchl
Perhaps try MSVC 2008. At least it worked for me, when I followed its wiki guide :)

Re: Problems with Compiling

Posted: 29 Jul 2008 09:08
by dbfriends
Hi,

I'm also having compiling-related problems... I'm on a Mac, tho. I downloaded the source and added a patch pack to it, then compiled. It runs fine as a bundle on my system, but when I try to copy that version to a friend's computer I have no luck at all.

I think it's because the compiler isn't adding some libraries or something (my compiled version is 6MB smaller than the original, downloaded one)... does anyone know how to force make to include these?

Re: Problems with Compiling

Posted: 30 Jul 2008 18:53
by ChefKoch
Ok I managed to compile it, I set the Paths, but didnt notice that it was saved to every solution seperate so I didnt have them for the new version I loaded.

Now comes maybe a totally retarded Question for you, but I managed to Build it but I cant run it. How do I go from Building to runing it? I found the ottd.exe but It wont run cus the necessary files arent there..

Thank you for your assistance.

Re: Problems with Compiling

Posted: 30 Jul 2008 19:51
by Mchl
Necessary files such as? If you mean original grf files, it's enough if you have them in 'My Documents' > 'OpenTTD' > 'data' folder.

Re: Problems with Compiling

Posted: 30 Jul 2008 21:01
by ChefKoch
when I put the GRF files there it tells me invalid language, wrong version?

See I dont get how I get from Building to playing.. shouldnt the files be put somewhere or how is this step done?

Re: Problems with Compiling

Posted: 31 Jul 2008 01:38
by glx
You need to copy openttd.exe from objs\win32\release to bin if you don't run it from MSVC.

Re: Problems with Compiling

Posted: 31 Jul 2008 10:48
by Alberth
I don't have any experience with a Mac, but let's have a try anyway:
dbfriends wrote:I'm also having compiling-related problems... I'm on a Mac, tho. I downloaded the source and added a patch pack to it, then compiled. It runs fine as a bundle on my system, but when I try to copy that version to a friend's computer I have no luck at all.
What do you mean 'no luck at all'?
The copy failed?, you couldn't start the binary?, OpenTTD exe complained about something?, Single player works, but multi-player doesn't?

Please state what doesn't work more precisely, if possible with the precise error reported by the system.

dbfriends wrote:I think it's because the compiler isn't adding some libraries or something (my compiled version is 6MB smaller than the original, downloaded one)... does anyone know how to force make to include these?
Depends on the compiler you use. One thing you may want to check is whether the set of installed libraries matches with each other, in particular those libraries that the OpenTTD Wiki/readme states as needed.

It may be the case that your compiler uses dynamic linking, where libraries are not added into the binary, but are loaded into memory when you start the program. That would be one possible explanation for the difference in size. Obviously, for this to work at a system, those libraries (with the precise version) need to be there when you run the program.

Albert

Re: Problems with Compiling

Posted: 31 Jul 2008 10:58
by dbfriends
Alberth wrote:What do you mean 'no luck at all'?
The copy failed?, you couldn't start the binary?, OpenTTD exe complained about something?, Single player works, but multi-player doesn't?
Copying it works fine - the binary is the same filesize and everything as on my machine. It's at the running-it stage that things fall over. OpenTTD tries to load and then just vanishes again. No error messages, nothing. It just doesn't appear!
Alberth wrote:Depends on the compiler you use. One thing you may want to check is whether the set of installed libraries matches with each other, in particular those libraries that the OpenTTD Wiki/readme states as needed.

It may be the case that your compiler uses dynamic linking, where libraries are not added into the binary, but are loaded into memory when you start the program. That would be one possible explanation for the difference in size. Obviously, for this to work at a system, those libraries (with the precise version) need to be there when you run the program.
This sounds like it might be the problem, I'll check it. I think my compiler would be GCC, does that make sense?!

Re: Problems with Compiling

Posted: 31 Jul 2008 11:18
by Alberth
dbfriends wrote:Copying it works fine - the binary is the same filesize and everything as on my machine. It's at the running-it stage that things fall over. OpenTTD tries to load and then just vanishes again. No error messages, nothing. It just doesn't appear!
If you don't even get a window for a few milliseconds, then yes, it might be a library loading problem.

I would expect (even in the above case) the system to complain about what is missing. However that will most likely be a textual error message that you only get when you start the program from a terminal window (and entering './openttd' in the 'bin' directory).
Unfortunately, it is quite difficult to test what happens at a working system, so I cannot easily try it here.
dbfriends wrote:This sounds like it might be the problem, I'll check it. I think my compiler would be GCC, does that make sense?!
Yes :)

You can query which libraries it uses with 'ldd'. Type 'ldd openttd' while you are in the 'bin' directory from the terminal window, and you get a list of libraries that it loads. Addresses of loading may change, but the libraries and their versions should match.

If possible, you could also try building openttd from the sources at the other machine.

Re: Problems with Compiling

Posted: 01 Aug 2008 10:44
by dbfriends
Alberth wrote:You can query which libraries it uses with 'ldd'. Type 'ldd openttd' while you are in the 'bin' directory from the terminal window, and you get a list of libraries that it loads. Addresses of loading may change, but the libraries and their versions should match.

If possible, you could also try building openttd from the sources at the other machine.
Cool! The Mac command differs a little bit but otool openttd -L does the same thing, apparently. Just for future reference :) I now have a list of libraries, I'll test it on my pal's machine ASAP.

I didn't really want to have to compile it on his, too, because the devtools download for Mac OS is a gigabyte :)