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

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
ivand
Posts: 310
Joined: 27 Jun 2007, 17:05

Post by ivand »

OMG, I hardly regret that I've chosen MSVC2005. I've lost this day fighting with f***in' manifest tool. It's really piss me off.

Does mingw have adequate IDE and debugger?
Last edited by ivand on 07 Jul 2007, 20:23, edited 1 time in total.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post by BrainDamage »

codeblocks as IDE and gdb as debugger
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Or DevCPP
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Unitsync wont compile in VS2005, the project needs converting from VS2003 and after correcting all the project library paths it complains of unresolved external symbols.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Code: Select all

	bool ValidIndex(int idx) const {
		return ((idx >= 0) && (idx < sounds.size()));
	}
In unitdef.h, cna this be changed? Its annoying seeing 20 or so of these warnings when you compile an AI.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Changed to what?

Which warnings?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

guessing - unsigned comparison.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

sounds.size() is unsigned
idx is signed
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

I'm getting some compile errors in LuaBinder.cpp. Essentially, it's failing to find the Lua related includes. I'm using scons and have not modified the SConstruct file. I'm getting the error in revsion 4177
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Maybe try a reconfigure, that may fix it.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

that worked. Thanks.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Post by Satirik »

where can I find the Command.h file ?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

rts/Sim/Units/CommandAI
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Post by Satirik »

edit : nevermind
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The unitsync project still have a VS2003 project and no VS2005 project file.

Its also out of date and wont compile citing numerous unresolved references to lua. What files need adding to the project?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Look in SConstruct
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I just did and re-added all the lua src folder and added 2 files I was missing earlier luautils.cpp and luaparser.cpp. I also added an include folder. I also added the missing GameVersion.cpp

Now lua compiles without the unresolved stuff.
VS2005 wrote:1>unitsync - 1 error(s), 1115 warning(s)
most of which involve lua_number and loss of data or precision.

The problem preventing compilation completing:

Code: Select all

1>------ Rebuild All started: Project: unitsync, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'unitsync', configuration 'Release|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>GameVersion.cpp
1>..\..\rts\Game\GameVersion.cpp(11) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>LuaWeaponDefs.cpp
1>c:\users\af-standardusr\documents\springsvn\rts\lua\LuaDisplayLists.h(36) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>c:\users\af-standardusr\documents\springsvn\rts\lua\LuaDisplayLists.h(58) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>c:\Users\AF-StandardUsr\Documents\springSVN\rts\Sim/Units/UnitDef.h(36) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>..\..\rts\Lua\LuaWeaponDefs.cpp(70) : warning C4244: 'argument' : conversion from 'const int' to 'lua_Number', possible loss of data
1>..\..\rts\Lua\LuaWeaponDefs.cpp(138) : warning C4244: 'argument' : conversion from 'int' to 'lua_Number', possible loss of data
1>..\..\rts\Lua\LuaWeaponDefs.cpp(306) : warning C4244: 'argument' : conversion from 'const int' to 'lua_Number', possible loss of data
1>..\..\rts\Lua\LuaWeaponDefs.cpp(311) : warning C4244: 'argument' : conversion from 'int' to 'lua_Number', possible loss of data
removing gameversion.cpp results in an unresolved reference to it followed by hundreds of lines of unresolved references to lua. VS2005 counted several hundred of these.
1>LuaWeaponDefs.obj : error LNK2001: unresolved external symbol "public: virtual class creg::Class * __thiscall WeaponDef::GetClass(void)" (?GetClass@WeaponDef@@UAEPAVClass@creg@@XZ)
1>LuaWeaponDefs.obj : error LNK2019: unresolved external symbol "public: __thiscall WeaponDef::~WeaponDef(void)" (??1WeaponDef@@QAE@XZ) referenced in function "bool __cdecl InitParamMap(void)" (?InitParamMap@@YA_NXZ)
1>../../game/unitsync.dll : fatal error LNK1120: 373 unresolved externals
1>Build log was saved at "file://c:\Users\AF-StandardUsr\Documents\springSVN\tools\unitsync\Release\BuildLog.htm"
1>unitsync - 944 error(s), 1136 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It seems most of these are externs inside lua.h

for example:

Code: Select all

/*
** basic stack manipulation
*/
LUA_API int   (lua_gettop) (lua_State *L);
LUA_API void  (lua_settop) (lua_State *L, int idx);
LUA_API void  (lua_pushvalue) (lua_State *L, int idx);
LUA_API void  (lua_remove) (lua_State *L, int idx);
LUA_API void  (lua_insert) (lua_State *L, int idx);
LUA_API void  (lua_replace) (lua_State *L, int idx);
LUA_API int   (lua_checkstack) (lua_State *L, int sz);

LUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);
where LUA_API is a macro for extern. There is no documentation specifying a location for the declarations of these externed variables and sconstruct does not say where they are either.

I have still not found the solution to the GameVersion.cpp issue either.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Turn off precompiled headers for GameVersion.cpp (all configurations), that should do the trick.

I'd say ignore the warnings, conversion from size_t to int and from int to float (which is LuaNumber IIRC) are perfectly fine in a library like unitsync IMHO.

Btw feel free to commit the converted and fixed project file once it compiles in all configurations (use batch build). (don't bother fixing warnings)
aash29
Posts: 15
Joined: 23 Sep 2007, 20:28

Post by aash29 »

greetings,
having a problem compiling Spring with mingw under Windows.
D:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lstreflop
collect2: ld returned 1 exit status
scons: *** [game\spring.exe] Error 1
scons: building terminated because of errors.
Can't post full report yet.

I read that several pepole have encountered this before and managed to overcome it by renaming streflop.a to libstreflop.a
But in my case no such file was produced. Someone also mentioned getting streflop.a from other source, but it isn't present in svn.
Thanks in advance
Post Reply

Return to “Engine”