Compiling spring (mingw and visual studio 7/8)
Moderator: Moderators
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
codeblocks as IDE and gdb as debugger
Code: Select all
bool ValidIndex(int idx) const {
return ((idx >= 0) && (idx < sounds.size()));
}
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.
The problem preventing compilation completing:
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.
Now lua compiles without the unresolved stuff.
most of which involve lua_number and loss of data or precision.VS2005 wrote:1>unitsync - 1 error(s), 1115 warning(s)
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
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 ==========
It seems most of these are externs inside lua.h
for example:
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.
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);
I have still not found the solution to the GameVersion.cpp issue either.
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)
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)
greetings,
having a problem compiling Spring with mingw under Windows.
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
having a problem compiling Spring with mingw under Windows.
Can't post full report yet.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.
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