Howto apply a patch/diff file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Search the wiki for the word compile. Something interesting should appear.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Post by ColdIce »

Yeah... thank you. Now I only have to browse 500 topics to find a program for compiling in windows! You know I asked here only because I didn't find something useful on google. Doesn't matter now, I will try to find myself a program and maybe I will find one! I will bother you later with other questions, I think, if you dont mind! :roll:
The rest is confetti!
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

ColdIce: as Belugas already said just before you posted in this topic, check out:

http://wiki.openttd.org/index.php/Categ ... ng_OpenTTD

A little bit of browsing in this topic can be useful ;) I agree that searching for 'compiling' doesn't get you anywhere. I hope this helps you out. Good luck!
The only thing necessary for the triumph of evil is for good men to do nothing.
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

Do I have a compiler problem if it hangs at

Code: Select all

make[1]: Leaving directory '/openttd/objs/lang'
make[1]: Entering directory '/openttd/objs/release'
[SRC] Compiling and Linking endian_check.exe
[SRC] Testing endianness for target
[SRC] DEP CHECK (all files)
make[1]: Leaving directory '/openttd/objs/release'
make[1]: Entering directory '/openttd/objs/release'
[SRC] Compiling and Linking endian_check.exe
[SRC] Testing endianness for target
[SRC] DEP CHECK (all files)
make[1]: Leaving directory '/openttd/objs/release'
and then keeps repeating these last steps, leaving and entering the /release directory, and performing DEP CHECK?

I must admit I have no experience at compiling. I am using Tortoise (no trouble there) and Cygwin on XP, and have downloaded all files to D:\Cygwin\Openttd - I hope it's not a problem this directory is underneath Cygwin itself.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

MJS wrote:Do I have a compiler problem if it hangs at
(..)
and then keeps repeating these last steps, leaving and entering the /release directory, and performing DEP CHECK?

I must admit I have no experience at compiling. I am using Tortoise (no trouble there) and Cygwin on XP, and have downloaded all files to D:\Cygwin\Openttd - I hope it's not a problem this directory is underneath Cygwin itself.
I would personally suggest to use mingw. Not only is the resulting binary independing of any dll or other stupid jokes of cygwin, it has also been proven to work much better and stable.
The only thing necessary for the triumph of evil is for good men to do nothing.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

It's not Cygwin's fault you're telling it to build a Cygwin-dependent binary. Tell it to build a -mno-cygwin binary, and it'll do so.

It may, however, still be Cygwin's fault that its libpng doesn't work.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

DaleStan, should I interpret your reaction as pointing out that I'd better reinstall Cygwin?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

No. And, as it appears, Cygwin does not (AFAICT, without actually having built the binary, which I'm working on now) build Cygwin-dependent binaries, so that half of TrueLight's objection is no longer true.

TrueLight: As far as I can tell, Cygwin has not built Cygwin-dependent binaries since at least revision 7942. Am I missing something important?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

DaleStan wrote:No.
Ah, well, so then the error must be in what I am compiling - or I am making a strange error somewhere. I have already downloaded the trunk twice (using Tortoise). Each time, I proceed by moving to that folder in the Cygwin environment, type ./configure --disable-static, and then type make. Did I miss anything?



edit 14 April, 23:20 GMT: I reinstalled Cygwin, and now it compiled just fine, after I adjusted the ft2build.h file, as is so adequately explained at the wiki page on Cygwin.

I now have in my objs/release folder the complete compilation. I have copied the data folder from my regular OTTD (including all grfs) underneath it; but it won't work. When I start openttd.exe, I get a message that Windows can't start openttd as it can't locate cygfreetype-6.dll. (That file is under my cygwin\bin folder.)

Should I start openttd from within Cygwin? I've tried run openttd.exe, got a message the language files were not there, moved the \lang folder underneath the \release folder, and then when I give the command 'run openttd.exe', nothing happens - no error messages either.

edit 15 April, 0:16 GMTI guess what should work is when I copy all of my original ottd-stuff into a new folder ottd_compiled, then copy the new ottd.exe and the /lang folder into it, and then run the programme from within Cygwin using ./openttd. Excuse for not having realized earlier that I probably need all openttd files, and not just the language folder...

However, it still won't work. For some reason, I get error messages saying my grfs and my sample.cat are missing - but they're there, right in this folder :S. Any hints?
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

Sorry for adding yet more info, but I'm quite glad to have been able to compile openttd.exe - and then finding it doesn't run because it can't find the files is a bit of a pity.

I've followed the advice that is given here to those who use a different compiler than Cygwin, and I have copied the /data and the /lang folder into the Cygwin /release folder where openttd.exe was compiled. However, now I don't get errors - just a black screen, with in the title bar 'OpenTTD r9621M'. (Have never seen the M before, but it might not be important at all.) Then, nothing. I run ./openttd from within Cygwin. Any suggestions?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

MJS wrote:(..)(Have never seen the M before, but it might not be important at all.)(..)
The M simply means you have local modifications :) The rest I can't help you with...
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 623
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

openttd.exe should be in bin (it's automatically copied in this dir)

--disable-static means you'll need the dlls, and they should be in your path. So if they are only in cygwin path, you should start openttd from cygwin.
User avatar
JamieLei
Tycoon
Tycoon
Posts: 7432
Joined: 10 Jan 2007 18:42
Location: Stratford, London

Post by JamieLei »

I seem to have problems merging and compiling
I have both windows and linux although i'm much more competent in windows
Whenever I try to merge the source and the patch, this happens (pic1)
therefore when i compile using cygwin, i get these errors (pic2), and when i try to load OpenTTD i get these errors (pic3). Could anyone help?
Attachments
3
3
pic3.gif (7.29 KiB) Viewed 5281 times
2
2
pic2.gif (11.3 KiB) Viewed 5281 times
1
1
pic1.jpg (1.64 KiB) Viewed 5281 times
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

JameiLei wrote:I seem to have problems merging and compiling
I have both windows and linux although i'm much more competent in windows
Whenever I try to merge the source and the patch, this happens (pic1)
therefore when i compile using cygwin, i get these errors (pic2), and when i try to load OpenTTD i get these errors (pic3). Could anyone help?
pic1 is just to notify you that the code has changed in comparison to the last time you synced with the svn server, and that is what you want if you apply a patch. no trouble here.

pic2 show nothing that could cause concern. its is just warnings that the code contains variables that is never used. warnings is not the same as errors when you compile. What cant be seen by this screenshot is if the were more serius things that has happened while compiling, but since there is no mention of errors before the prompt i think it is ok.

pic3 ... i dont know anything about that.

one thing that would be nice to know is if you can compile and run the code without any modifications or patches.
User avatar
JamieLei
Tycoon
Tycoon
Posts: 7432
Joined: 10 Jan 2007 18:42
Location: Stratford, London

Post by JamieLei »

i feel really stupid now
the only cause of the errors upon startup was that i'd forgotten to copy over the grfs from the original game

thanks anyway
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

glx wrote:openttd.exe should be in bin (it's automatically copied in this dir)

--disable-static means you'll need the dlls, and they should be in your path. So if they are only in cygwin path, you should start openttd from cygwin.
I have tried again. Compiling went wonderful, no problems there.

Now, I am still in the cygwin environment. I move to the /bin subfolder of the folder in which I typed 'make' (d:/cygwin/openttd in my case). There's an openttd.exe there; but then I get an error message (in a Windows window, not in the Cygwin command line interface) saying my language packs are missing. But they're there - right below the /bin directory is the /lang directory with everything in. I have also copied sample.cat and the other needed files (+ some other grfs) to /bin/data.

I'm sorry, I find the folder structure rather confusing. I also have a new folder /objs underneath the /openttd folder. Do I need to do anything with that?
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

One more try. I've compiled everything, and I've found the /trunk/bin folder where Openttd.exe is. So in cygwin I go to /usr/src/ottd_trunk/bin, and type openttd there, right?

I get an error saying my language packs aren't properly installed. However, right underneath /bin I have got the /lang folder, with all *.lng files plus english.txt in there (as well as a few other files). Inside bin/objs there is another /lang folder, of which I have copied all contents into this lang folder as well, just to be sure... What have I done wrong?
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

MJS wrote:One more try. I've compiled everything, and I've found the /trunk/bin folder where Openttd.exe is. So in cygwin I go to /usr/src/ottd_trunk/bin, and type openttd there, right?

I get an error saying my language packs aren't properly installed. However, right underneath /bin I have got the /lang folder, with all *.lng files plus english.txt in there (as well as a few other files). Inside bin/objs there is another /lang folder, of which I have copied all contents into this lang folder as well, just to be sure... What have I done wrong?
Actually you should probably copy a few cygwin dll files to the dir with openttd.exe and then try to run it from windows directly, it is a windows native file. I hope it helps, im not that much into cygwin, i use mingw myself.
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

Hi kaan,

Thanks for helping me. I've copied all cygwin dlls (from Cygwins own /bin folder) to the /trunk/bin folder, and ran Openttd.exe from there.

I get just a black window, with the Ottd version number (OpenTTD r9806) in the title bar - but nothing else. Well, a ttd-style mousepointer, sometimes. It hangs immediately, and I don't see any crashlogs (does ottd provide crashlogs?)... Any further hints how I could find out what's wrong?

I've seen announcements of your new tool, and it looks promising - does it allow users to apply patches as well?
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

MJS wrote:Hi kaan,

Thanks for helping me. I've copied all cygwin dlls (from Cygwins own /bin folder) to the /trunk/bin folder, and ran Openttd.exe from there.

I get just a black window, with the Ottd version number (OpenTTD r9806) in the title bar - but nothing else. Well, a ttd-style mousepointer, sometimes. It hangs immediately, and I don't see any crashlogs (does ottd provide crashlogs?)... Any further hints how I could find out what's wrong?

I've seen announcements of your new tool, and it looks promising - does it allow users to apply patches as well?
Im arfaid that i cannot help you with that problem.

As for the program i made: Yes you can include a patch.
That being said i will also have to say that this is the very first beta so im not sure if it work correctly.
The best advise i can give you is to follow the mingw instructions in the wiki witch i updated recently, i know that that works at least :)

http://wiki.openttd.org/index.php/Compiling_on_MinGW
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 14 guests