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

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
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

I didn't touch NTai, it compiled fine (note that I don't use VS for spring compiles.) Single-include strategy in KAIs made it quite a puzzle.

As for MSVC not understanding that cmath should put things in namespace std... that's just fail. I hope it's not as bad as it sounds.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

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

Post by submarine »

Could anyone add such a compaibility header? I would do it myself if I knew what to do...

And what about the other error messages - can anyone actually build spring with vsnet 2005??
submarine wrote:

Code: Select all

1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(51) : error C2143: syntax error : missing ',' before '&'
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(65) : error C2065: 'overload_rep' : undeclared identifier
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(53) : error C2923: 'std::vector' : 'overload_rep' is not a valid template type argument for parameter '_Ty'
1>        d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(51) : see declaration of 'overload_rep'
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(53) : error C2663: 'std::vector<_Ty,_Alloc>::begin' : 2 overloads have no legal conversion for 'this' pointer
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(53) : error C2663: 'std::vector<_Ty,_Alloc>::end' : 2 overloads have no legal conversion for 'this' pointer
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(53) : error C2065: 'o' : undeclared identifier
1>d:\Spiele\TA Spring Source\rts\lib\luabind\luabind/detail/method_rep.hpp(54) : error C2663: 'std::vector<_Ty,_Alloc>::end' : 2 overloads have no legal conversion for 'this' pointer
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

I'll try to do something about it today, luabind is a freaking fragile piece of code and it's possible that I broke it for msvc when I made it to work with gcc 4.3.
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 »

Considering fnordia is the one who used luabind whereas trepan didnt use it iirc couldn't you just factor luabind out?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

The LUA start(mission) scripts depend on it.

Don't think it's really trivial to redo it without (ie. factor it out), but I would support it. (because with all the fancy C++ it causes more headaches than it solves)
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

I think I fixed the msvc std::math errors (don't want to install platform sdk to find out if spring works, but those errors no longer show up.)

No idea how to reproduce luabind errors.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

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

Post by submarine »

ok I fixed another std:: problem in GameServer.cpp, someone has to fix the LUA part now...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

describe how to reproduce those errors plz
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

I'm looking at them, I have them too. (I can reproduce them just by pressing build..., but apparently some setting we don't know about influences this. I have PSDK & 2 DX SDKs installed, might have to do with it...)

I already tried adding #undef add_overload, but that didn't work.

EDIT: the header that contains struct overload_rep isn't included :s
I added "#error moo" and I got no error about that.

EDIT 2: hmm that seems more MSVC weirdness. it does see the #error but doesn't get around to showing it apparently :s I figured out it somehow manages to get the struct overload_rep definition after the add_overload method, which needs the overload_rep definition...

EDIT 3: ... and found the guilty lines of code, in overload_rep.hpp:

Code: Select all

// actually, gcc cannot see pointer_converters before it sees class_rep
#if defined(BOOST_MSVC) // || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
#include <luabind/detail/policy.hpp>
#endif
This causes an #include cyclic dependency which causes the classes to be put in the preprocessed file in the wrong order.

Now testing whether it compiles without this.

imbaczek: maybe the boost you use for MSVC doesn't have BOOST_MSVC #defined?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

*bump*

fixed now
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

It actually crossed my mind that this line has something to do with the error, but couldn't prove it. Anyways, gcc's error messages weren't better ^^
NeoSkye
Posts: 2
Joined: 20 Apr 2008, 02:27

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

Post by NeoSkye »

lurker wrote:
pentup wrote:Hello, I'm new around here. I used to be a huge TA fan, and recently found out about spring, so decided to take a look at it. I tried compiling it using VC8 and the Windows SDK (which I believe replaces the PlatformSDK) and got the following error:

Code: Select all

CrashHandler.cpp
..\..\System\Platform\Win\CrashHandler.cpp(91) : warning C4312: 'type cast' : conversion from 'DWORD' to 'HINSTANCE' of greater size
..\..\System\Platform\Win\CrashHandler.cpp(134) : error C2664: 'SymEnumerateModules' : cannot convert parameter 2 from 'BOOL (__stdcall *)(LPSTR,DWORD,PVOID)' to 'PSYM_ENUMMODULES_CALLBACK'
        None of the functions with this name in scope match the target type
After it failed, I downloaded the latest version of the PlatformSDK and everything compiled fine. I just wanted to let somebody know for future compatibility or whatever, that the current code doesn't compile (out of the box, at least) with the new Windows SDK.
Thank you very much for this information. I installed VC9, and that is one of two errors that keep it from compiling.
Hey, new here, but I just thought I'd pipe in and say that I'm using VC9 Express and Windows SDK and of course got the error above. I fixed it by changing the definition of EnumModules to:
static BOOL CALLBACK EnumModules(PCSTR moduleName, ULONG baseOfDll, PVOID userContext)

which seems to have worked(not sure why the compiler refused to convert for me)

Still working on this other nasty error. I'll update if i figure it out.

**UPDATE: So I think I fixed the other error too. It was an ambiguous call that for some reason the compiler couldn't figure out based on namespace. I updated line 91 in has_get_pointer.hpp from
value=sizeof(has_get_pointer_::check((get_pointer(x),0) )) == 1

to
value=sizeof(has_get_pointer_::check((luabind::detail::has_get_pointer_::get_pointer(x),0) )) == 1

and it seems to be compiling fine. Still having trouble linking. As before, I'll continue to update as I work through this :)
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

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

Post by Das Bruce »

I can't seem to configure scons, it keeps saying that it can't find gcc when it's trying to determine the version. I've tried a couple of different values in the environment variables, anyone had the same problem?

Nvm, fixed itself :roll:
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

Scons stopped working :(

Code: Select all

scons: Reading SConscript files ...
make: *** No targets specified and no makefile found.  Stop.
mingw32-make: *** No targets specified and no makefile found.  Stop.
Failed building streflop!
It compiled earlier without any problems. Anyone know what happened and how to fix it?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

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

Post by LordMatt »

Did you run it from the right folder?
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

I run it in my Spring source folder, it compiled several times earlier, but now i am getting the same message every time :/
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

try reconfigure?
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

You mean "scons configure" ? Tried it several times, it says:

Code: Select all

(...)
Everything seems OK.  Run `scons' now to build.
(...)
and "scons" still doesn't work...
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

Ok I deleted \build, \rts\build\scons, \SConstruct in my Spring source folder, then obtained them again from SVN + redownloaded mingwlibs + uninstalled scons and installed it back and it finally works!!! :P
at least i didn't have to format my disk... :)

Now I have to wait only about 1 hour until it all compiles, then I can start testing my patch again... :wink:
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

if you have dual core, use scons -j2 for parallel compiles.
Post Reply

Return to “Engine”