Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu May 23, 2019 6:00 pm

All times are UTC




Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Wed Mar 27, 2019 3:28 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
DISCLAIMER: This is a development problem. Does this topic belong here or in the OpenTTD Problem section?

PROBLEM: Using MinGW I am able to compile OpenTTD 1.8.0, but 1.9.0 fails in both nightly and beta:
[+] Spoiler
Code:
$ make
make[1]: Entering directory `/usr/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9
.0-RC2/objs/lang'
[LANG] Compiling core/alloc_func.cpp
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/core/
alloc_func.cpp: In function 'void MallocError(size_t)':
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/core/
alloc_func.cpp:22:68: warning: use of 'I' length modifier with 'u' type characte
r has either no effect or undefined behavior [-Wformat=]
  error("Out of memory. Cannot allocate " PRINTF_SIZE " bytes", size);
                                                                    ^
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/core/
alloc_func.cpp: In function 'void ReallocError(size_t)':
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/core/
alloc_func.cpp:31:70: warning: use of 'I' length modifier with 'u' type characte
r has either no effect or undefined behavior [-Wformat=]
  error("Out of memory. Cannot reallocate " PRINTF_SIZE " bytes", size);
                                                                      ^
[LANG] Compiling string.cpp
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/strin
g.cpp: In function 'char* strcasestr(const char*, const char*)':
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/strin
g.cpp:548:47: error: 'strncasecmp' was not declared in this scope
   if (strncasecmp(haystack, needle, needle_len) == 0) return const_cast<char *>
(haystack);
                                               ^
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/strin
g.cpp: In function 'int strnatcmp(const char*, const char*, bool)':
C:/MinGW/msys/1.0/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.0-RC2/src/strin
g.cpp:606:26: error: 'strcasecmp' was not declared in this scope
  return strcasecmp(s1, s2);
                          ^
make[1]: *** [string.o] Error 1
make[1]: Leaving directory `/usr/home/Wall/4_OTTD_nightly/2_compile/openttd-1.9.
0-RC2/objs/lang'
make: *** [all] Error 1

DISCUSSION: This issue coincides with the move to Git.
There may be a problem with the required packages. Did a package change or was a new package introduced?
I went to the Compiling section of the OpenTTD Development page to review the libraries.
This page has the following note:
Quote:
For further instructions on how to properly set up your system to build OpenTTD, take a look at our wiki page about development environments.

That wiki page is titled Coding Tools. On March 17 it was deleted by andythenorth with the comment "(Strongly outdated, no need to keep)". There was no suggestion for an alternate source for instructions on how to properly set up a system to build OpenTTD nor any discussion concerning development environments.

So, now I must question the validity of the library list with respect to MinGW. Is the page Compiling on Windows using MinGW still valid?
Are the libraries the source of my problem?

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Last edited by wallyweb on Sun Apr 14, 2019 7:40 am, edited 4 times in total.

Top
   
PostPosted: Wed Mar 27, 2019 11:40 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Fri Dec 02, 2005 3:43 pm
Posts: 620
Location: Drancy(93) - France
Compilation is indeed broken with MSYS/MinGW, but with MSYS2/MinGW-w64 there's no issues. You can follow instructions on the page Compiling on Windows using MSYS2


Top
   
PostPosted: Thu Mar 28, 2019 2:24 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
glx wrote:
Compilation is indeed broken with MSYS/MinGW, but with MSYS2/MinGW-w64 there's no issues. You can follow instructions on the page Compiling on Windows using MSYS2
Thank you very much. :bow:
This gives me exactly what I was looking for. Installation begins tomorrow morning.
If there are any questions, they will be posted below.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Fri Mar 29, 2019 12:22 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Apparently msys2 has abandoned Windows XP support:

Current MSYS2 can't be installed on Windows XP anymore.

I have poked about their website and am unable to find an archive of older versions.
Any suggestions (other than upgrade my system)?

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Fri Mar 29, 2019 5:25 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Archive found! :D

Cygwin ended its XP support in April 2016, so I went with msys2-i686-20160205.e x e 05-Feb-2016 18:12
It's not exactly as posted on the OpenTTD wiki instruction page, but it's close.
I just need to iron out a couple of bugs (probably mine) and then I will post my comments below, probably tomorrow.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Thu Apr 04, 2019 8:50 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
wallyweb wrote:
... msys2-i686-20160205.e x e 05-Feb-2016 18:12 ...
It's not exactly as posted on the OpenTTD wiki instruction page, but it's close.
I just need to iron out a couple of bugs (probably mine) and then I will post my comments below.

This was not a smooth experience. The installer did not refuse WindowsXP ... BUT ... compiling did not get past ./configure.
SOLUTION:
1. Buy a refurbished Window10 laptop.
2. Install MSYS2 - msys2-x86_64-20180531.exe
3. Test with MinGW32 to get an OpenTTD 32 bit compilation.
4. ./configure produced:
Code:
WARNING: liblzo2 was not detected or disabled
WARNING: OpenTTD doesn't require liblzo2, but it does mean that
WARNING: loading old savegames/scenarios will be disabled.
configure: error: no liblzo2 detected
If you want to compile without liblzo2 use --without-liblzo2 as parameter

5. Compiled without liblzo2
6. A game saved on WindowsXP loaded without problem.
QUESTION:
What is meant by "old savegames/scenarios"?

Note that liblzo2-2.10-2-x86_64.pkg.tar.xz does exist in MSYS2 and there were no problems when compiling OpenTTD under MinGW64.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Fri Apr 05, 2019 3:55 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7350
"old savegames" means "savegames created with [very] old versions of OpenTTD", e.g. the title savegame of the trunk/nightly version which is probably almost 15 years old now. which exact savegames are affected probably depends on what game versions and settings the person making the savegames used. it is technically still possible to make such savegames with the current version of the game, but you need some fairly deep understanding of settings to even set that up.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Fri Apr 05, 2019 4:20 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Eddi wrote:
...
Thanks Eddi. :bow:

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Sun Apr 07, 2019 9:15 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Compiled OpenTTD master using MinGW32 on Windows10.
Executable works fine in Windows10.
Copied the file to WindowsXP.
Got this runtime error:

Code:
The procedure entry point _except_handler4_common could not be located in the dynamic link library msvcrt.dll


msvcrt.dll does exist in my WindowsXP System32 folder.

Any thoughts or suggestions?

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Mon Apr 08, 2019 9:16 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jan 26, 2001 8:18 pm
Posts: 23959
Skype: orudge
Location: Banchory, UK
You'd need to use an older version of mingw32 (but one new enough to support the C++11 functionality that we use). I couldn't say precisely which version would be appropriate though, I'm afraid.

You could also install Visual Studio Community 2017 then switch the OpenTTD project to use the v140_xp compiler, which should produce an executable that will run on XP SP3 at least. (You'll need to tick the "Windows XP support for C++" option in the "Individual components" tab of the installer.)

_________________
Owen Rudge
owenrudge.net | Owen's Transport Tycoon Station | Owen's Locomotion Depot | The Transport Tycoon Wiki


Top
   
PostPosted: Mon Apr 08, 2019 10:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Hello Owen,

Thank you for looking in on this.

I did not know that MinGW32 was available as a standalone. The installer is for msys2 with MinGW32 and 64 seeming to be integral to the bundle. A previous attempt to install Visual C++ was too much of a challenge and I was driven to MinGW/msys which worked fine until the transition from XP to 7 and 10.

Apparently this is a known issue as described here

A couple of days ago I used the OpenTTD 1.9.0 stable 32bit installer on my XP box with no issues.
I then used msys2/MinGW32 on my Windos10 laptop and complied the source code available from the same page. I then moved that executable to my XP box and got the same old error.
Now, I assume that the OpenTTD crew used the same source code to build the installer version.
So now the question is what is the difference between OpenTTD's compiler and msys2?
Would it be safe to borrow msvcrt.dll from my 10 machine and copy it into XP?

Regards,

Wally

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Tue Apr 09, 2019 9:43 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jan 26, 2001 8:18 pm
Posts: 23959
Skype: orudge
Location: Banchory, UK
The build log is available here - OpenTTD's build system uses MSVC.

I'd probably suggest downloading Visual Studio Community (these days it's quite straightforward to install) - "desktop development for C++" should be sufficient hopefully. After installing Visual Studio, you'll also need to install vcpkg and integrate it (steps listed in the readme there), then run:

vcpkg install bzip2:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static bzip2:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static

Then you should be able to open the OpenTTD Visual Studio solution and build it, hopefully.

Copying msvcrt.dll from Windows 10 to Windows XP is likely a very bad idea - although once upon a time it was a somewhat independent library (being the Visual C++ 6.0 C runtime DLL), these days it's shipped with the OS and probably contains OS-specific hooks. And actually, checking the DLL on my system, it has a minimum Windows version of 10.0 baked into it, so it wouldn't work anyway.

_________________
Owen Rudge
owenrudge.net | Owen's Transport Tycoon Station | Owen's Locomotion Depot | The Transport Tycoon Wiki


Top
   
PostPosted: Wed Apr 10, 2019 3:40 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
orudge wrote:
I'd probably suggest downloading Visual Studio Community (these days it's quite straightforward to install) - "desktop development for C++" should be sufficient hopefully. After installing Visual Studio, you'll also need to install vcpkg and integrate it (steps listed in the readme there),
I think Visual Studio (VS) installed properly.
The VS "start?" page offers a prominent option to clone or check out code.
The vcpkg readme offers a link to its git repository.
The git code was downloaded and installation proceeded automatically.

Quote:
then run:

vcpkg install bzip2:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static bzip2:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static

Where does one invoke "run"? This is not obvious. There is no cursor after which to type the install instruction. The help page offers nothing obvious, nor does the readme.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Wed Apr 10, 2019 9:36 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jan 26, 2001 8:18 pm
Posts: 23959
Skype: orudge
Location: Banchory, UK
That should be in a command prompt. Something like:

mkdir c:\various\vcpkg
cd /d c:\various\vcpkg
git clone https://github.com/Microsoft/vcpkg
bootstrap-vcpkg
vcpkg integrate install
vcpkg install bzip2:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static bzip2:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static

Then you should be able to open Visual Studio, point it at the OpenTTD solution (projects\openttd_vs142.sln), and hopefully build it. I still can't guarantee that the generated build will work on Windows XP though!

_________________
Owen Rudge
owenrudge.net | Owen's Transport Tycoon Station | Owen's Locomotion Depot | The Transport Tycoon Wiki


Top
   
PostPosted: Sat Apr 13, 2019 4:29 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
orudge wrote:
Then you should be able to open Visual Studio, point it at the OpenTTD solution (projects\openttd_vs142.sln), and hopefully build it. I still can't guarantee that the generated build will work on Windows XP though!


Build failed:
Code:
Severity   Code   Description   Project   File   Line   Suppression State
Error   C1083   Cannot open include file: 'ft2build.h': No such file or directory (compiling source file ..\src\fontcache.cpp)   openttd   C:\Users\User\source\repos\OpenTTD\src\fontdetection.h   19   
Error   C1083   Cannot open include file: 'ft2build.h': No such file or directory (compiling source file ..\src\fontdetection.cpp)   openttd   C:\Users\User\source\repos\OpenTTD\src\fontdetection.h   19   
Error   C1083   Cannot open include file: 'ft2build.h': No such file or directory   openttd   C:\Users\User\source\repos\OpenTTD\src\crashlog.cpp   52   
Error   C1083   Cannot open include file: 'ft2build.h': No such file or directory (compiling source file ..\src\strings.cpp)   openttd   C:\Users\User\source\repos\OpenTTD\src\fontdetection.h   19   


I searched in src. ft2build.h is not there.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Sat Apr 13, 2019 5:23 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4713
Location: home
Indeed, there is no ft2build.h in src. It's at /usr/include/freetype2/ft2build.h at my system, that is, part of the freetype2 library.

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Sat Apr 13, 2019 6:59 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5505
Location: Canada
Alberth wrote:
Indeed, there is no ft2build.h in src. It's at /usr/include/freetype2/ft2build.h at my system, that is, part of the freetype2 library.
Thanks Alberth.
I found it on my system at C:\msys64\mingw32\include\freetype2\ft2build.h
Now the question is how to get it into Visual Studio 2019.
vcpkg does have freetype, but I do not see freetype2.
I ran vcpkg install freetype, and then recompiled openttd_vs142 but got the same errors.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Sat Apr 13, 2019 7:16 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5267
@wally
It's called "change for change's sake". :twisted:

regards
Michael

_________________
Image


Top
   
PostPosted: Sat Apr 13, 2019 7:25 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4713
Location: home
wallyweb wrote:
Alberth wrote:
Indeed, there is no ft2build.h in src. It's at /usr/include/freetype2/ft2build.h at my system, that is, part of the freetype2 library.
Thanks Alberth.
I found it on my system at C:\msys64\mingw32\include\freetype2\ft2build.h
Now the question is how to get it into Visual Studio 2019.
vcpkg does have freetype, but I do not see freetype2.
I ran vcpkg install freetype, and then recompiled openttd_vs142 but got the same errors.
The "2" in the filename indicates to me it's aiming at freetype2 instead.
I found https://github.com/ShiftMediaProject/freetype2 , which aims to create visual studio freetype2. As I have no Windows at all, I can't say if it is useful or even how to install/fix things, but maybe you can figure it out or someone else can help?

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Sat Apr 13, 2019 7:32 am 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jan 26, 2001 8:18 pm
Posts: 23959
Skype: orudge
Location: Banchory, UK
wallyweb wrote:
Alberth wrote:
Indeed, there is no ft2build.h in src. It's at /usr/include/freetype2/ft2build.h at my system, that is, part of the freetype2 library.
Thanks Alberth.
I found it on my system at C:\msys64\mingw32\include\freetype2\ft2build.h
Now the question is how to get it into Visual Studio 2019.
vcpkg does have freetype, but I do not see freetype2.
I ran vcpkg install freetype, and then recompiled openttd_vs142 but got the same errors.

I missed freetype from the vcpkg list (thought it had removed on Windows, but it was only a PR). You need to install freetype:x86-windows-static and freetype:x64-windows-static. Despite the name, it is freetype2.

OpenTTD requires the “windows-static” variants - it won’t pick up the regular version.

_________________
Owen Rudge
owenrudge.net | Owen's Transport Tycoon Station | Owen's Locomotion Depot | The Transport Tycoon Wiki


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.