Prissi
Since I am building for Win32, I do not think that I need 64-bit libraries, do I? I have already copied the files that I have in my Windows include and library directories to folders pointed to with -I and -L flags in the FLAGS= setting in config.mingw.
However, I am coming upon a problem of some complexity. If I do not add /usr/include manually by an -I/usr/include flag, I get the error that it cannot find iconv.h. The only copy of iconv.h is in /usr/include. However, when I include /usr/include, the version of pthread.h in there conflicts with the version that seems to be included by default with mingw in its own mingw include folder (which is included automatically without a flag), and the compiler then generates great numbers of error messages about redefinitions.
I did try copying just iconv.h from /usr/include to the Open TTD include directory, but had no success there, as I then had multiple compiler errors for things that were in turn referenced from iconv.h.
I am not sure what to do about this. Any help would be appreciated.
TurfIt
May I ask what compiler that you are using in which you are getting the pthread error? The thing that you are recommending to be changed is in a file supplied as part of the pthread module itself: it is not a Simutrans file. Is there an issue of incompatible pthreads versions, I wonder?
As to the libraries, may I ask what you mean when you refer to installing something into a prefix? gcc -v will surely give information about the Linux GCC/G++ compiler, rather than mingw? It has its own library and include directories, albeit ones that omit zlib (but have pthreads).
For reference, I get:
root@438242:/usr/share/games/nightly/simutrans-experimental/makeobj# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
As to the libraries, it seems that I need to understand better how libraries work given your comments. Do I infer from what you wrote that, even when cross-compiling for Windows, files with a .lib extension are not suitable for use with GCC? I presume from this that there is another sort of library file that is suitable, but I am not sure what sort of library file that it might be or where to get it.
In dealing with libraries in the past, I have, for Windows, downloaded the library files (usually with a .lib extension), put them in a folder, and told Visual Studio to find libraries in that folder. For Linux, I have just installed the relevant libxxx packages with apt (e.g. "apt-get install libpng-dev"), and the system itself has taken care of the files themselves and where they go, so I have never had to deal with the details of the files before.
For cross-compiling, I am not clear on what I need. Do I need Windows libraries (given that I am building for Windows), Linux libraries (given that I am building on Linux), or some sort of special cross-compile libraries (in which case, where can I find those)?
Please forgive me if this is a silly question: I am afraid that I have never tried any sort of cross-compiling before, so this is all new to me and the available documentation seems very scant.
In relation to Open TTD, the instructions for compiling Simutrans do specify using a lot of the libraries for Open TTD (especially zlib and libpng or their Windows equivalents), at least for Windows, and downloading the set of OpenTTD libraries is an explicit instruction on the "how to compile Simutrans" stickied post. Prissi said to use the same libraries on Linux for cross-compiling as I was using in Windows, which is why I copied the contents of the Open TTD libraries/include files folder.
Thank you all very much for your help so far.