Page 2 of 6

Re: [solved] Mingw compiling problems

Posted: 20 Dec 2009 19:08
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.

Re: [solved] Mingw compiling problems

Posted: 20 Dec 2009 21:04
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:

Re: [solved] Mingw compiling problems

Posted: 04 Aug 2010 19:54
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 :-)

Re: [solved] Mingw compiling problems

Posted: 11 Aug 2010 12:09
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)

Re: [re-unsolved] Mingw compiling problems

Posted: 12 Aug 2010 07:08
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?

Re: [re-unsolved] Mingw compiling problems

Posted: 12 Aug 2010 07:16
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.

Re: [re-unsolved] Mingw compiling problems

Posted: 12 Aug 2010 07:41
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:

Re: [re-unsolved] Mingw compiling problems

Posted: 12 Aug 2010 17:52
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.

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 19:36
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)

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 19:44
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

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 19:56
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.

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:24
by Dante123
as you suggested, but not working:
error3.PNG
error3.PNG (73.43 KiB) Viewed 1001 times

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

here is the screen how i did it:
fixed1.PNG
fixed1.PNG (14 KiB) Viewed 3667 times

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:29
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)

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:31
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 3661 times

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:37
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)

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:43
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:

Re: [re-unsolved] Mingw compiling problems

Posted: 15 Aug 2010 20:50
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(

Re: [re-unsolved] Mingw compiling problems

Posted: 16 Aug 2010 12:58
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

Re: [re-unsolved] Mingw compiling problems

Posted: 07 Sep 2010 10:07
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.

Re: [re-unsolved] Mingw compiling problems

Posted: 07 Sep 2010 12:44
by Lord Aro
thanks Terkhen, i'll edit the wiki when i get the time