[re-unsolved] Mingw compiling problems

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

Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: [solved] Mingw compiling problems

Post by Rubidium »

Lord Aro wrote: is it ok to upload (to the forums) a binary with just opengfx and opensfx so it works without original files?
You can try, but uploading ~20 MiB to the forum won't work as it's way over the limit.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [solved] Mingw compiling problems

Post by Lord Aro »

Rubidium wrote:
Lord Aro wrote: is it ok to upload (to the forums) a binary with just opengfx and opensfx so it works without original files?
You can try, but uploading ~20 MiB to the forum won't work as it's way over the limit.
ah. yes. didn't think about that... :rolleyes:
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
Muzzly
Traffic Manager
Traffic Manager
Posts: 226
Joined: 09 Jun 2010 20:54
Location: Vilnius, LT

Re: [solved] Mingw compiling problems

Post by Muzzly »

Hello,

I just want to inform people about following small problem that I
faced and solved :-)

I tried to setup a minGW compiling enviroment on my windows 7 pc. But I had some problems by compiling wget. After executing ./mingwPORT.sh configure "spit out" following error:
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
./mingwPORT.sh: /usr/src/wget-1.9.1/bld/src/config.h: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
The same error appeared by compiling pnglib and other libraries.
I was willing to ask for solution in this forum, but as I said I found the reason :-)

The fault was my antivirus. It just silently removed all a.exe files created by configure script. So solution would be temporary to disable antivirus :-)
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [solved] Mingw compiling problems

Post by Lord Aro »

unsolved!

am trying to set up mingw again, but the link to svn on the wiki is broken. when i locate what i believe to be v 1.6.2 (as on wiki) there are no folders inside named: iconv, licenses, share (there is a bin)
same with latest version of svn (1.6.12)
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Lord Aro »

solved!

i was downloading a source file
found a win32 binary now
am updating wiki

EDIT:
now get this error when attempting to do stuff (compile?) to zlib1.2.3

Code: Select all

$ ./mingwPORT.sh
Download file? (Yes) 
Download file URI? (http://www.zlib.net) 
Archive file type?
0) unknown
1) tar.gz
2) tgz
3) tar.bz2
4) tbz2
5) zip
Select a numeric value: (3) 
Archive file? (zlib-1.2.3.tar.bz2) 
Download to path? (/tmp) 
Source path? (/usr/src/zlib-1.2.3) 
Installation directory? (/mingw) 
CFLAGS (-O3 -s -mms-bitfields -march=i686) 
--07:54:25--  http://www.zlib.net/zlib-1.2.3.tar.bz2
           => `zlib-1.2.3.tar.bz2'
Resolving www.zlib.net... 69.73.181.135
Connecting to www.zlib.net[69.73.181.135]:80... connected.
HTTP request sent, awaiting response... 404 Not Found
07:54:29 ERROR 404: Not Found.

tar (child): /tmp/zlib-1.2.3.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u3pr zlib-1.2.3/win32/Makefile.gcc zlib-1.2.3-mingwPORT/win32/Makefile.gcc
|--- zlib-1.2.3/win32/Makefile.gcc      Fri Aug  1 23:49:00 2003
|+++ zlib-1.2.3-mingwPORT/win32/Makefile.gcc    Wed Feb  1 11:48:04 2006
--------------------------
No file to patch.  Skipping patch.
3 out of 3 hunks ignored
/usr/src/zlib-1.2.3
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'.  Stop.
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'.  Stop.
make: win32/Makefile.gcc: No such file or directory
make: *** No rule to make target `win32/Makefile.gcc'.  Stop.
EDIT2: there appear to have been 2 other posts on the forums about this subject and it appears that zlib1.2.3 isn't available anymore, yet there is no zlib1.2.5-mingwPORT version. anyone got any ideas?
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [re-unsolved] Mingw compiling problems

Post by planetmaker »

Install another, newer zlib. The automatic installer seems broken as it doesn't find the file / URL it searches for.

But you should always know what you at least want to do.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Lord Aro »

that's my point, there doesn't appear to be a mingwPORT file for zlib1.2.5

i've found this thing called portmaker but i've tried and failed on that, so anyone else want a go? :lol:
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Gremnon »

I've got the same.
It seems that the mingwPORT applies patches to zlib that make it work. I've attempted to use those same patches on 1.2.5, but they fail to apply, and I can't find where it's hiding the code it's trying to patch, nor the patchfile it's trying to use.
Scautura
Engineer
Engineer
Posts: 102
Joined: 01 Aug 2006 07:30

Re: [re-unsolved] Mingw compiling problems

Post by Scautura »

For those of you having issues with zlib, I have the zlibport and zlib (1.2.3) available for download on my server (both are freely distributable, and come without warranty)

http://www.scautura.co.uk/bg/zlib-1.2.3 ... -1.tar.bz2
http://www.scautura.co.uk/bg/zlib-1.2.3.tar.gz

See below: (I made a mistake)
Last edited by Scautura on 15 Aug 2010 20:01, edited 2 times in total.
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the universe together.
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Dante123 »

the download will fail 404, that is coorect.

but when you pick the No for download,
that will give the error: no such file or directory.

so than again the question, where exactly does it try to look for that tmp folder ? so i put it in manual ?
if i dont know that exact place where to put it, it wont work
Scautura
Engineer
Engineer
Posts: 102
Joined: 01 Aug 2006 07:30

Re: [re-unsolved] Mingw compiling problems

Post by Scautura »

MSYS links the /tmp folder to your Windows TEMP folder

Oooh, I think I missed something... Sorry...

Code: Select all

$ ./mingwPORT.sh
Download file? (Yes) no
Unarchive file? (Yes)
Archive file type? (tar.bz2) tar.gz
Archive file? (zlib-1.2.3.tar.gz)
Archive file path? (/tmp) /home/Chris/zlib-1.2.3/mingwPORT
I'll edit the prior post to reflect that change (add "." on the "Archive file path?" question)

Edit: That's wierd - I don't know why it doesn't like the "." ("This folder") - I'll see if I can tweak it.

This should work - substitute your own folder where I've put mine (a quick way to find out where you are currently is "pwd" - then you can copy and paste). If you have zlib-1.2.3.tar.gz in your home folder, I don't see why you can't use "~", but I haven't tested.

Alternatively, at this line:

Code: Select all

Download file URI? (http://www.zlib.net) 
Put "http://www.scautura.com/bg", then select "tar.gz" (1) for the next option.
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the universe together.
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Dante123 »

as you suggested, but not working:
error3.PNG
error3.PNG (73.43 KiB) Viewed 333 times

**EDIT**
YES!!!
got it!

here is the screen how i did it:
fixed1.PNG
fixed1.PNG (14 KiB) Viewed 2999 times
Last edited by Dante123 on 15 Aug 2010 20:29, edited 1 time in total.
Scautura
Engineer
Engineer
Posts: 102
Joined: 01 Aug 2006 07:30

Re: [re-unsolved] Mingw compiling problems

Post by Scautura »

From the beginning:

Code: Select all

$ ./mingwPORT.sh
Download file? (Yes) 
Download file URI? (http://www.zlib.net) http://www.scautura.com/bg
Archive file type?
0) unknown
1) tar.gz
2) tgz
3) tar.bz2
4) tbz2
5) zip
Select a numeric value: (3) 1
Archive file? (zlib-1.2.3.tar.bz2) zlib-1.2.3.tar.gz
Download to path? (/tmp) 
Source path? (/usr/src/zlib-1.2.3) 
Installation directory? (/mingw) 
CFLAGS (-O3 -s -mms-bitfields -march=i686) 
Make sure that you select "1" (tar.gz) and that the "Archive file" has a filename with tar.gz at the end of it (if you have to specify completely, specify "zlib-1.2.3.tar.gz") - it will download the file from my server (I've just tested this part works)
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the universe together.
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Dante123 »

editied my last post, got it working :)

i have just put all in C:\test1
adn than as you stated put those 2 in the windows temp, and in the same place as that .sh file was.
now it worked :) :bow:

edit:
although the last part seems to give a lot of errors:

Code: Select all

gcc -O3 -s -mms-bitfields -march=i686 -c -o example.o example.c
gcc  -s -o example example.o libz.a
gcc -O3 -s -mms-bitfields -march=i686 -c -o minigzip.o minigzip.c
gcc  -s -o minigzip minigzip.o libz.a
gcc  -s -o example_d example.o libzdll.a
gcc  -s -o minigzip_d minigzip.o libzdll.a
/bin/sh.exe: -c: line 2: syntax error: unexpected end of file
make: [install] Error 2 (ignored)
/bin/sh.exe: -c: line 2: syntax error: unexpected end of file
make: [install] Error 2 (ignored)
cp -fp zlib.h 
cp: missing destination file
Try `cp --help' for more information.
make: [install] Error 1 (ignored)
cp -fp zconf.h 
cp: missing destination file
Try `cp --help' for more information.
make: [install] Error 1 (ignored)
cp -fp libz.a 
cp: missing destination file
Try `cp --help' for more information.
make: [install] Error 1 (ignored)
cp -fp libzdll.a 
cp: missing destination file
Try `cp --help' for more information.
make: [install] Error 1 (ignored)
rm -f libz.a
rm -f zlib1.dll
rm -f libzdll.a
rm -f *.o
rm -f *.exe
rm -f foo.gz
**edit2**
and ofc.... the rest of the wiki fails again:

wiki:
5. Now its time to make the files available where they are needed. Run:

Code: Select all

mkdir /usr/local/include
mkdir /usr/local/lib
cp /mingw/include/zlib.h /mingw/include/zconf.h /usr/local/include
cp /mingw/lib/libz.a /usr/local/lib
result:
error4.PNG
error4.PNG (5.49 KiB) Viewed 2993 times
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Lord Aro »

congrats!
even so, i shall attempt to get 1.2.5 into a mingwPORT version :x (that's a concentrated face btw)
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Dante123 »

Lord Aro wrote:congrats!
even so, i shall attempt to get 1.2.5 into a mingwPORT version :x (that's a concentrated face btw)
well, drop me a line or pm when i can give it a new go :P

ahh well, if only that buildTTD was still alive :roll:
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Lord Aro »

Dante123 wrote:
Lord Aro wrote:congrats!
even so, i shall attempt to get 1.2.5 into a mingwPORT version :x (that's a concentrated face btw)
well, drop me a line or pm when i can give it a new go :P
don't worry about that, i'll post it everywhere possible (since a proper one by the proper mingwPORT people doesn't seem to exist yet) X(
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
MeDiCS
Engineer
Engineer
Posts: 26
Joined: 11 Jul 2010 13:02

Re: [re-unsolved] Mingw compiling problems

Post by MeDiCS »

I'd strongly advise against using the MinGWPORT version, since it's outdated and contains some bugs fixed in the newest version (1.2.5). Compiling from source isn't hard, and a precompiled DLL is also provided in the official website (http://www.zlib.net/).

To compile from source (both static and dynamic libraries):

Code: Select all

make -f win32/Makefile.gcc
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: [re-unsolved] Mingw compiling problems

Post by Terkhen »

This is a method for getting a working MinGW/MSYS installation that is able to compile OpenTTD. It is just a step-by-step description of the method posted by Rubidium at the discussion page of the wiki. Once this gets tested I welcome anyone interested to complete this and update the wiki (which is not very helpful right now). Note that this method still misses libicu.
  • Download luna installer from http://lunac.sourceforge.net/ (tested with Release 3), and install it (don't forget the installation directory). This includes both MinGW and MSYS.
  • Download the following files and place them at installation_folder/mingw/home/USERNAME/
  • Extract these files (you might need 7-Zip for some of them).
  • Run MSYS (installation_folder/mingw/msys.bat).
  • Compile and install zlib:

    Code: Select all

    cd zlib-1.2.5
    make -f win32/Makefile.gcc BINARY_PATH=/bin INCLUDE_PATH=/include LIBRARY_PATH=/lib install
    cd ..
  • Compile and install liblzo2:

    Code: Select all

    cd lzo-2.03
    ./configure --bindir=/bin --includedir=/include --libdir=/lib --enable-static
    make install
    cd ..
  • Compile and install libpng:

    Code: Select all

    cd lpng143
    mv INSTALL INSTALL.txt
    make -f scripts/makefile.mingw install
    cd ..
    
  • Compile and install libfreetype:

    Code: Select all

    cd freetype-2.4.0
    ./configure --bindir=/bin --includedir=/include --libdir=/lib --enable-static
    make install
    cd ..
  • Now you should be able to compile OpenTTD. Of course you will still need to checkout the code with svn/hg/git first. You also can remove the downloaded files/folders.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: [re-unsolved] Mingw compiling problems

Post by Lord Aro »

thanks Terkhen, i'll edit the wiki when i get the time
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 22 guests