Mingw/VS WIP

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Mingw/VS WIP

Post by shenle »

I'm trying to get (again) VS to compile with mingw.

A big obstacle is that Python doesn't support mingw as a build system. I have tried to do it and I ended up stalling when it complains of undeclared identifiers. A lengthy google search doesn't seem to get an answer. Few people have attempted to use python with mingw, there are a few (incomplete) instructions from back in 2003/python-2.2; there's also https://gitorious.org/mingw-python but it doesn't compile either (unknown type name 'Py_UNICODE')

If anyone here has any pointers or knows of a python version or patch that works on mingw, please post about it. At this moment I don't seem to make any progress.
Last edited by pheonixstorm on Tue Nov 29, 2011 5:05 am, edited 1 time in total.
Reason: Added topic attribute
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

check around the bloodshed Dev C++ site. They use mingw as the compiler and i'm sure someone there should have gotten a copy of python to compile.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

Well I don't see much on the site itself. They do link to http://devpaks.org/ but I don't see anything related to python there either.

(edit) I did find python 2.5 http://devpaks.org/details.php?devpak=167 but I don't think I want to use that. Besides the download link is dead, there is an active link but it has python-2.4.1 which should be way too old to use.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

Might be too old but it could shed some light on where to find the errors. There is another devpak site as well, or at least when you run the pak manager there is a listing for another site.. don't have the software installed so can't say what the other site is... :(
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

The other site is on planetmirror.com... and it returns a 404 :(

Overall the whole DevC++ devpak site appears derelict, many files listed but missing. Sad.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

I found what looks to be a package of python 2.7.1 for mingw at http://code.google.com/p/mingw-and-ndk/ ... w32-bin.7z

testing now. Wish me luck.

(when are we porting VS to Android? :D)

(edit) damn, the VS configure script still can't find python - even though the package itself appears to be working fine on mingw.
(edit2) OK seems I got over that one... the configure script wants python to be installed in /usr and nowhere else, but of course mingw doesn't have /usr :) Or actually it does but it's inside the msys subsystem.
Now onto SDL, OpenGLU and the other things.

(edit3) same problem with GLU, the script only looks in /usr/include and /usr/lib but mingw has it in /include and /lib

Even after moving the openGLU headers and libs to msys (which serves as /usr) the configure script still can't find them... even though it did find OpenGL32 without any problem. Using the --with-glu-lib-name= and --with-glu-libs= doesn't help either.

(edit4) the combination --with-glu-libs=/lib --with-glu-lib-name=glu32 works for mingw.

Now it complains of glext.h being too old. Downloaded from oss.sgi.com/projects/ogl-sample/ABI/glext.h and trying again
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

Next step: glut missing. First I tried using freeglut but it became too messy quickly so I ended up using this page for reference: http://www.joshuaburkholder.com/glut/ and built my own. Seems to work.

Next missing dependency: expat. That was easy - "mingw-get install expat libexpat" did the trick.

Next: zlib and libpng. Compiled in order and installed from the latest sources. Except that "make install" fails for zlib so headers and libs need to be copied manually to their locations. And of course the configure script cannot find libpng and needs to be told where it is. And even then it still cannot find it. Grrr.

I'll stop here for now and continue at a later time.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

Sounds like a good run so far. I've got expat and sdl ready for x64 platforms. Not much left to build an x64 project left. Just need to add the configuration in the project solution and run a test compile.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

Well I still can't get configure to find libpng; it continues to fail even when it's pointed right at it.

Okay, 'libpng-config --libs' returns '-lpng15'
I am manually editing the configure script to look for png15: change

Code: Select all

PNG_LIB_LIST="png png12"
to

Code: Select all

PNG_LIB_LIST="png png12 png15"
(edit) damn still cannot find it. I'm out of ideas.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Mingw/VS WIP

Post by klauss »

Does cmake work any better in mingw?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

klauss wrote:Does cmake work any better in mingw?
Haven't tried this time but based on my previous experience with cmake on windows I'd say no.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

Unfortunately no matter what I do it seems I'm stuck at libpng. The configure script can't find it.




here are my quick-n-dirty notes so far:
attempting to compile vegastrike (rev 13230, 11/18/11) on Win7/64 with mingw

updated VS svn repository to 13230
installed mingw32 and msys from mingw-get-inst-20110802.exe
configured with C, C++, MSYS

in MSYS;
cd to vs repo
./bootstrap-sh
./configure: missing python

download python-2.7.2:
./configure
make: fails with undeclared symbols

google: found https://gitorious.org/mingw-python (python 2.7.1 with patches for mingw)
needs git to download
git needs openssl to compile

d/l openssl-1.0.0e
./config
make
make test
make install

cd to git-1.7.7.3

(for some reason ./configure fails, but git is already configured)
./configure
make (fails with missing socklen_t)

Gave up, checked out mingw-python from url above with TortoiseGit.

mingw-python:
./configure

No use doesn't work.

Get mingw package of python 2.7.1 from http://code.google.com/p/mingw-and-ndk/ ... me=python-

2.7.1-mingw32-bin.7z; unpack it in mingw32/msys/1.0 (so that python.exe ends up in mingw32/msys/1.0/bin)

Tell ./configure where to find GLU libraries: --with-glu-libs=/lib --with-glu-lib-name=glu32

Download a newer glext.h from http://oss.sgi.com/projects/ogl-sample/ABI/glext.h and replaced the existing one

in mingw32/include/GL

Download SDL-1.2.14.tar.gz http://www.libsdl.org/release/SDL-1.2.14.tar.gz and build (make sure you have nasm

in the path - but nasm 2.07 from 7/19/09 gives errors so if you have this version make sure to remove it):
configure
make
make install

Download zlib-1.2.5 and libpng-1.5.6: http://prdownloads.sourceforge.net/libp ... z?download

and http://zlib.net/zlib-1.2.5.tar.gz

Actually you're better off with "mingw-get install zlib libz"
then in libpng configure/make test/make install

current config line:

../vegastrike/configure --with-glu-libs=/lib --with-glu-lib-name=glu32

Stalls at not recognizing libpng as installed.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

Trying again, this time with cmake under mingw installed from source.

Of course the fact that every single file in cmake-2.8.6 raises a false positive with my antivirus doesn't help things. :)
(seriously, I have about 15 files that are supposedly infected with something called Win32::Oficla-BD [Drp], whatever that is)

And of course like I remembered cmake on windows is a disaster. First it won't recognize its own path if it's installed anywhere else than in its default directory, C:\Program Files\Cmake 2.8 - any change from that exact path and cmake doesn't work. And when it works, it won't find python even if it's told where to find it.

No, cmake on windows is not usable.
And autotools won't find libpng.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

I wonder if the following snippet of configure.ac is to blame:

Code: Select all

AC_DEFUN([CHECK_FOR_PNG_LIB], [
    AC_MSG_CHECKING([for $PNG_LIB_NAME library])
    LIBS="$PNG_LDOPTS -l$PNG_LIB_NAME"
    AC_TRY_LINK([#include <png.h>], 
                [unsigned char head[8]; png_sig_cmp(head,0,8); png_set_expand_gray_1_2_4_to_8(NULL);], 
                have_png_lib=yes, have_png_lib=no )
    AC_MSG_RESULT([$have_png_lib])
]) 

saved_LIBS="$LIBS"

PNG_LIB_LIST="png png12"

for PNG_LIB_NAME in $PNG_LIB_LIST ; do
    CHECK_FOR_PNG_LIB

    if test "x$have_png_lib" = "xyes" ; then
        break;
    fi
done
As I seem to remember there were some problems with png_set_expand_gray_1_2_4_to_8 recently; the current png.h from libpng-1.5.6 has the following:

Code: Select all

PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structp png_ptr));
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

In absence of a better solution as a temporary fix I hacked configure.ac so that the check for png always succeeds; it also couldn't find png.h unless expressly pointed to where it's installed, in this case /usr/local/include.

Next: jpeg-8c downloaded from http://www.ijg.org/files/jpegsrc.v8c.tar.gz and compiled the usual way. Big surprise, configure can't find it unless paths to libs and includes specified. :)

This was the last required dependency, as ffmpeg and gtk are non-fatal. Got a makefile, now compiling. :)
(a bit puzzled that it didn't ask for boost; it's not installed in mingw, so the compile may yet fail)

(edit) Grrr, again it can't find libpng; I give up.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

Yeah, I can't get cmake to even pull up an entry for libpng so I can generate new solution files for VC10 or a 64 bit. On XP I get the compiler is broken and under 7 it will run through most of the stuff until it hits libpng. I think for XP its a VC9 install issue.. but so long as the source files are listed in the cmake file I can rebuild it by hand if need be.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Mingw/VS WIP

Post by klauss »

shenle wrote: (seriously, I have about 15 files that are supposedly infected with something called Win32::Oficla-BD [Drp], whatever that is)
Are you sure your PC isn't infected?
I got mine infected once, and I had to stop building windows binaries because they came out infected with the virus. I never reinstalled windows, I just formatted into linux, so I no longer build windows binaries, but the thing remains that an infected PC might result in infected binaries even if just built.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

klauss wrote:
shenle wrote: (seriously, I have about 15 files that are supposedly infected with something called Win32::Oficla-BD [Drp], whatever that is)
Are you sure your PC isn't infected?
I got mine infected once, and I had to stop building windows binaries because they came out infected with the virus. I never reinstalled windows, I just formatted into linux, so I no longer build windows binaries, but the thing remains that an infected PC might result in infected binaries even if just built.
Yeap, pretty sure. I run weekly full scans, plus I ran another full scan just after I ran into this issue. All the occurences of the detection were in the cmake package which I had just downloaded from the Kitware web site.

Aaanyway...

I didn't give up right away, still gave it a last try after modiufying the configure script some more, to force detection of libpng...
...and I got a (supposedly) working makefile again...
... and it doesn't know how to "make vegastrike", only "make all" :)...
... and it stops with a boatload of errors while compiling the first source file of the project, one of the networking files, with stuff that seems pretty basic to me (complaining about tr1::unordered_set and so on) which is telling me that probably mingw isn't going to work without some major code cleanup.

_now_ I give up. :(
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

Go ahead and post all those errors. Maybe we can make some sense out of them or at least figure out how to clean that portion of the code up so it will spit out the next block of errors.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

It will take some time, because for the next 2 weeks I'm a few hundred miles away from the computer on which I did all that other work. :) Should be pretty easy to reproduce though, but it's time consuming and I only have my laptop with me (it's ridiculously underpowered BTW)
make me a sandwich
make: *** No rule to make target 'me'. Stop.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Mingw/VS WIP

Post by pheonixstorm »

no rush ;)
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

here ya go courtesy of my craptop

stdout

Code: Select all

patch -N -p0 < boost_gcc44.patch || true
make  all-am
make[1]: Entering directory `/h/dls/vegastrike/svn/mingw'
depbase=`echo src/networking/lowlevel/netbuffer.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	g++ -DHAVE_CONFIG_H -I. -I../vegastrike   -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I../vegastrike/boost/1_45  -pipe -DNV_CUBE_MAP  -DNOMINMAX -DHAVE_SDL=1 -DSDL_WINDOWING=1    -I/usr/include -I/usr/local/include -DJPEG_SUPPORT -I/usr/local/include -DNV_CUBE_MAP=1  -I/usr/include/python2.7 -DHAVE_PYTHON=1    -I../vegastrike/src   -pipe -DNV_CUBE_MAP  -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -D_REENTRANT -MT src/networking/lowlevel/netbuffer.o -MD -MP -MF $depbase.Tpo -c -o src/networking/lowlevel/netbuffer.o ../vegastrike/src/networking/lowlevel/netbuffer.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
make[1]: Leaving directory `/h/dls/vegastrike/svn/mingw'
stderr

Code: Select all

/bin/sh: boost_gcc44.patch: No such file or directory
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.6.1/include/c++/unordered_map:35:0,
                 from ../vegastrike/src/gnuhash.h:26,
                 from ../vegastrike/src/hashtable.h:25,
                 from ../vegastrike/src/xml_support.h:10,
                 from ../vegastrike/src/configxml.h:31,
                 from ../vegastrike/src/networking/lowlevel/vsnet_clientstate.h:28,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.h:9,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.cpp:2:
c:\mingw32\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
In file included from ../vegastrike/src/xml_support.h:10:0,
                 from ../vegastrike/src/configxml.h:31,
                 from ../vegastrike/src/networking/lowlevel/vsnet_clientstate.h:28,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.h:9,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.cpp:2:
../vegastrike/src/hashtable.h:38:26: error: 'std::tr1' has not been declared
../vegastrike/src/hashtable.h:38:26: error: expected '{' before 'unordered_map'
../vegastrike/src/hashtable.h:38:32: error: expected initializer before '<' token
In file included from ../vegastrike/src/configxml.h:31:0,
                 from ../vegastrike/src/networking/lowlevel/vsnet_clientstate.h:28,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.h:9,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.cpp:2:
../vegastrike/src/xml_support.h:62:46: error: field 'forward' has incomplete type
../vegastrike/src/xml_support.h:63:54: error: field 'reverse' has incomplete type
In file included from ../vegastrike/src/easydom.h:35:0,
                 from ../vegastrike/src/configxml.h:32,
                 from ../vegastrike/src/networking/lowlevel/vsnet_clientstate.h:28,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.h:9,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.cpp:2:
../vegastrike/src/vsfilesystem.h:82:9: error: 'tr1' in namespace 'std' does not name a type
../vegastrike/src/vsfilesystem.h:83:27: error: 'FileLookupCache' was not declared in this scope
../vegastrike/src/vsfilesystem.h:83:44: error: 'cache' was not declared in this scope
../vegastrike/src/vsfilesystem.h:83:51: error: expected primary-expression before 'const'
../vegastrike/src/vsfilesystem.h:83:82: error: expected primary-expression before 'type'
../vegastrike/src/vsfilesystem.h:83:87: error: expression list treated as compound expression in initializer [-fpermissive]
../vegastrike/src/vsfilesystem.h:131:8: error: 'tr1' in namespace 'std' does not name a type
In file included from ../vegastrike/src/configxml.h:32:0,
                 from ../vegastrike/src/networking/lowlevel/vsnet_clientstate.h:28,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.h:9,
                 from ../vegastrike/src/networking/lowlevel/netbuffer.cpp:2:
../vegastrike/src/easydom.h:81:5: error: 'tr1' in namespace 'std' does not name a type
../vegastrike/src/easydom.h: In member function 'void easyDomNode::set_attribute(std::string, std::string)':
../vegastrike/src/easydom.h:72:9: error: 'attribute_map' was not declared in this scope
../vegastrike/src/easydom.h: At global scope:
../vegastrike/src/easydom.h:88:9: error: 'tr1' in namespace 'std' does not name a type
../vegastrike/src/easydom.h:95:15: error: 'tagMap' has not been declared
../vegastrike/src/easydom.h: In member function 'void tagDomNode::Tag(int*)':
../vegastrike/src/easydom.h:97:31: error: no match for 'operator[]' in '* tagmap[easyDomNode::Name()()]'
make[1]: *** [src/networking/lowlevel/netbuffer.o] Error 1
make: *** [all] Error 2
attached config.log zipped
You do not have the required permissions to view the files attached to this post.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Mingw/VS WIP

Post by klauss »

pheonixstorm wrote:Go ahead and post all those errors. Maybe we can make some sense out of them or at least figure out how to clean that portion of the code up so it will spit out the next block of errors.
It's not so much of a cleanup.

unordered_set is part of the TR1 spec, which is a newer part of the C++ spec. It's probable that mingw is using a quite old compiler, and that autoconf or the code itself isn't properly detecting the issue. It's just a matter of:
  • A: installing the newer stl into mingw, or
  • B: fixing ghuhash.h or whichever file is involved to properly detect mingw's situation
The code already has a fallback for old compilers, it's just a matter of telling it how to recognize mingw.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Mingw/VS WIP

Post by shenle »

mingw uses gcc-4.6.1 which is only a few months old. Perhaps it doesn't have all features enabled/installed though.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Mingw/VS WIP

Post by klauss »

shenle wrote:mingw uses gcc-4.6.1 which is only a few months old. Perhaps it doesn't have all features enabled/installed though.
Then I'd say you have an installation error somewhere, since it seems your gcc is using a very old STL, while usually gcc 4.6 comes with tr1 and a lot more.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Post Reply