lzma and string.cpp errors while trying to compile OpenTTD with a patch

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
User avatar
GuilhermeJK
Engineer
Engineer
Posts: 55
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

lzma and string.cpp errors while trying to compile OpenTTD with a patch

Post by GuilhermeJK »

Hello guys, first time trying to compile something as large as OpenTTD in Windows, so I'm new to the whole ./configure and makefile things.

My goal is to compile the source to test two particular patches:
-> Native seaplane airport (viewtopic.php?t=72959)
-> Another Daylength patch (viewtopic.php?f=33&t=42432&start=380)

*EDIT*: My first attempt was to compile with only the seaplane patch as I read that patching more than one at the same time is trickier. One step at a time :)

I followed the wiki's article on using MinGW to compile OpenTTD and two non-expected things happened:

1. as I ran ./configure on both patched source and 'clean' source, lzma was not detected and the makefile was not created.

2. I tried running ./configure --without-lzma and while compiling this happened:

Code: Select all

$ make
make[1]: Entering directory `/c/Users/GJ/openttd-1.6.1-source/objs/lang'
[LANG] Compiling and Linking endian_check.exe
[LANG] Testing endianness for host
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
c:/Users/GJ/openttd-1.6.1-source/src/string.cpp: In function 'char* strcasestr(c
onst char*, const char*)':
c:/Users/GJ/openttd-1.6.1-source/src/string.cpp:537:47: error: 'strncasecmp' was
 not declared in this scope
   if (strncasecmp(haystack, needle, needle_len) == 0) return const_cast<char *>
(haystack);
                                               ^
c:/Users/GJ/openttd-1.6.1-source/src/string.cpp: In function 'int strnatcmp(cons
t char*, const char*, bool)':
c:/Users/GJ/openttd-1.6.1-source/src/string.cpp:585:26: error: 'strcasecmp' was
not declared in this scope
  return strcasecmp(s1, s2);
                          ^
make[1]: *** [string.o] Error 1
make[1]: Leaving directory `/c/Users/GJ/openttd-1.6.1-source/objs/lang'
make: *** [all] Error 1
How should I proceed?

Thanks
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: lzma and string.cpp errors while trying to compile OpenTTD with a patch

Post by Eddi »

which version of MinGW did you install, and which version of gcc are you using?

(you can ignore lzma as long as you don't want to load savegames by other people, or join servers)

you can try compiling trunk instead of 1.6.1, maybe there was a fix in there.
User avatar
GuilhermeJK
Engineer
Engineer
Posts: 55
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

Re: lzma and string.cpp errors while trying to compile OpenTTD with a patch

Post by GuilhermeJK »

using gcc -v on msys console tell my gcc's version is 5.3.0

My MinGW version I got the latest from sourceforge "MinGW get" installer, so I don't know exactly where to check the actual MinGW version.
User avatar
GuilhermeJK
Engineer
Engineer
Posts: 55
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

Re: lzma and string.cpp errors while trying to compile OpenTTD with a patch

Post by GuilhermeJK »

SOLVED!!!

I've managed to compile it via Visual Studio 2008 Express, with the seaplane airport.

Thanks to the people that wrote that article on the OpenTTD wiki :)
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: lzma and string.cpp errors while trying to compile OpenTTD with a patch

Post by Eddi »

GuilhermeJK wrote:My MinGW version I got the latest from sourceforge "MinGW get" installer, so I don't know exactly where to check the actual MinGW version.
It's usually better to use the exact version that the wiki page was tested with, instead of the "newest" version, because incompatibilities might have been introduced.
GuilhermeJK wrote:SOLVED!!!

I've managed to compile it via Visual Studio 2008 Express
that's like saying "i repaired the broken taillight in my car by buying a new car"...
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests