Compiling spring (mingw and visual studio 7/8) - Page 29

Compiling spring (mingw and visual studio 7/8)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Compiling spring (mingw and visual studio 7/8)

Post by AF »

I would rather use Visual Studio to develop NTai than have to set up a mingw environment everyday at uni then have to set it up again from scratch everytime I log out.

So mingw is not an option for AI development right now.

That and despite numerous attempts, I could never get debugging to work with mingw.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring (mingw and visual studio 7/8)

Post by hoijui »

AF, you might check out the wiki, and try the most obvious spot: development - windows - visual studio
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Compiling spring (mingw and visual studio 7/8)

Post by AF »

If I was running with visual studio 2005 yes, if I was running under Visual Studio 2008 no ( I'm running 2008! )
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

I tried compiling Spring tag 0.80.5.2 with CMake + MinGW on Windows XP sp2 and got a few small errors in the Spring code (which I quickly fixed), but I still get boost errors while linking which I dont know how to fix - see attached file.

Anyone knows what I am doing wrong?
It seems these boost libs are MT versions while I compile non-MT Spring, but Mingwlibs pack comes only with these libs. What should I do then?

And btw does MinGW save compile logs somewhere?
Thx for help in advance.
Attachments
console.txt
Error while linking
(21.04 KiB) Downloaded 154 times
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Compiling spring (mingw and visual studio 7/8)

Post by Tobi »

Which version of MinGW?

(On first sight, it seems your MinGW is compiling Spring for one type of exception handling, while boost is compiled for the other type.)
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

It seems to be:
gcc version 3.4.5
GNU Make 3.81
__MINGW32_VERSION 3.15.2
__W32API_VERSION 3.13
(provided by a batch file found in google ;))

Spring Wiki says I should use "official MinGW + GCC 4.4.0" so I assume I have got a wrong version.
Getting the correct versions of all the stuff now.
I will post later if Spring finally builds or not.
Rafal99 wrote:And btw does MinGW save compile logs somewhere?
Edit: Nevermind this one, I am noob afraid of the command line... :oops:
"make > log.txt" FTW
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

I installed the latest MinGW and GCC 4.4.0 but the same thing happened again while linking.
I have found that there are some conflicts in my PATH environment variable and in some other places (damn Dev-Cpp spammed its path everywhere), and the wrong stuff is used. When finally I managed to fix all that problems Spring builds successfully. :-)
Thanks for help!
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Compiling spring (mingw and visual studio 7/8)

Post by slogic »

hoijui wrote:AF, you might check out the wiki, and try the most obvious spot: development - windows - visual studio
It is not actually obvious under 2008. __stdcall keyname forces to decorate exported AI functions under 2008. Even if you wrap them with extern "C" it does not help. So, you have to link a .def file which "patches" __stdcall decorations with contents like this:

Code: Select all

EXPORTS
	getLevelOfSupportFor
	init
	release
	handleEvent
After that it can be attached by AI interface.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

The link in the first post is 404, may need updating.

The correct one seems to be:
http://springrts.com/wiki/Building_spring


Edit: Wow! Getting Mingw to work is so much easier these days, thanks to TDM installer.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

Image

mingw_errors.txt
(90.48 KiB) Downloaded 129 times
This the output from stderr after running "mingw32-make install-spring". The last 2 lines in in stdout were:

Code: Select all

Linking CXX executable ..\..\..\spring.exe
Creating library file: libspring.dll.a
I have got the latest Spring source and mingwlibs from git, also tried setting up everything from scratch like 3 times but always the same result.

Any idea what is wrong and how to fix?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring (mingw and visual studio 7/8)

Post by hoijui »

i do not know if it is this, but as much as i know, the last mingw tdm reported to work well for compiling spring is 4.5. i had problems with 4.6 aswell, when i tried. i though the wiki mentions this, though.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

The wiki (at least the Compiling Spring on Windows page) doesn't mention anywhere that mingw version 4.5 has to be used. I checked two times.
So thanks for the tip, I will try installing the tdm with 4.5 and we will see if this was the cause of errors. If it really was then wiki has to be more specific because right now it is logical to assume that the latest version is best and should be used.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

I tried compiling with Mingw 4.5.2 and still exactly same errors.
An another player who tried to compile on Windows told me in lobby that he got the same errors too.
Any help?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Compiling spring (mingw and visual studio 7/8)

Post by abma »

it looks like for some reason the linker flags seems to be invalid:

http://vladimir_prus.blogspot.com/2009/06/linking-101.html

can you attach CMakeCache.txt ?


here i tried with mingw gcc 4.6.1 and it works fine (should be the current version)... strange :-/
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

Here it is:
CMakeCache.txt
(85.25 KiB) Downloaded 124 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Compiling spring (mingw and visual studio 7/8)

Post by abma »

make VERBOSE=1 shows commands that are done to link...

it looks like -lboost_system-mt is missing in the linker command line but the CMakeCache.txt looks imo fine...
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Compiling spring (mingw and visual studio 7/8)

Post by jK »

<FOOBAR>
Rafal99 wrote:The wiki (at least the Compiling Spring on Windows page) doesn't mention anywhere that mingw version 4.5 has to be used. I checked two times.
It does quite well mention what you have to install ...
->
wiki wrote:Because the official MinGW installer and packages are outdated, we recommend to use the TDM web-installer instead, to install the official MinGW Stable (not TDM-GCC) package:
</FOOBAR>
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: Compiling spring (mingw and visual studio 7/8)

Post by Rafal99 »

Mingw output with VERBOSE=1:
mingw_log.txt
(594.2 KiB) Downloaded 125 times
Error output same as before.


@jK:
TDM webdl installer was what I was using. It didn't know then that there is only one version of it which always gets the latest Mingw.
Anyway the point was hypothetical refering to hoijui post that Mingw GCC must be 4.5, but since it proved wrong, it is invalid.
User avatar
nrv
Posts: 24
Joined: 05 Aug 2010, 10:06

Re: Compiling spring (mingw and visual studio 7/8)

Post by nrv »

mingw-gcc 4.6.1-2 here and unable to compile due to boost errors too :

undefined reference to `boost::system::system_category()'
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Compiling spring (mingw and visual studio 7/8)

Post by abma »

does adding

Code: Select all

#define BOOST_FILESYSTEM_VERSION 2
in

Code: Select all

mingwlibs/include/boost/config/user.hpp
fix the linker error?
Post Reply

Return to “Engine”