win7 mingw build failing on strnlen

win7 mingw build failing on strnlen

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
malric
Posts: 521
Joined: 30 Dec 2005, 22:22

win7 mingw build failing on strnlen

Post by malric »

Trying to compile the engine on Win7 with mingw. First time I do such a thing so I have no clue what/if I am doing something wrong.

I get the error at http://pastebin.com/YzDhw8GU, which is basically:

Code: Select all

C:\Users\vladms\personal\projects\spring\git.vladms\rts\System\FileSystem\RapidH
andler.cpp: In function 'std::string GetNameFromFile(const string&, const string
&)':
C:\Users\vladms\personal\projects\spring\git.vladms\rts\System\FileSystem\RapidH
andler.cpp:54:36: error: 'strnlen' was not declared in this scope
Any suggestion what it is wrong with my setup?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: win7 mingw build failing on strnlen

Post by Beherith »

Dont make all. Just: mingw32-make engine-legacy
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win7 mingw build failing on strnlen

Post by abma »

Beherith wrote:Dont make all. Just: mingw32-make engine-legacy
no...please report such errors! :)

also rts\System\FileSystem\RapidHandler.cpp:54 IS engine-legacy...
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win7 mingw build failing on strnlen

Post by abma »

@malric

does https://github.com/spring/spring/commit ... 09e6aee0d0 fix the compile error?
malric
Posts: 521
Joined: 30 Dec 2005, 22:22

Re: win7 mingw build failing on strnlen

Post by malric »

That was my first try as well, but it did not solve it.

To make it work I have done the modifications Beherits suggests (adding fpermissive and commenting the icon) at: http://springrts.com/phpbb/viewtopic.ph ... 38#p554938

I have mingw 64 with compiler 4.8.1.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win7 mingw build failing on strnlen

Post by abma »

malric wrote:That was my first try as well, but it did not solve it.
does it fix THIS specific error and you where just hitting an other one? if so, error message would be useful.
malric
Posts: 521
Joined: 30 Dec 2005, 22:22

Re: win7 mingw build failing on strnlen

Post by malric »

Guess it is fixed (I mean develop HEAD gives another error).

The error I get now on develop HEAD is below (which looks like the thing fix by -fpermissive). Probably the type of the set occlusionQueries is wrong..

Code: Select all

[ 38%] Building CXX object rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/
Lua/LuaOpenGL.cpp.obj
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp: In st
atic member function 'static int LuaOpenGL::DeleteQuery(lua_State*)':
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp:4277:5
0: error: cast from 'const void*' to 'long unsigned int' loses precision [-fperm
issive]
  GLuint q = (unsigned long int)lua_topointer(L, 1);
                                                  ^
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp: In st
atic member function 'static int LuaOpenGL::RunQuery(lua_State*)':
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp:4296:5
0: error: cast from 'const void*' to 'long unsigned int' loses precision [-fperm
issive]
  GLuint q = (unsigned long int)lua_topointer(L, 1);
                                                  ^
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp: In st
atic member function 'static int LuaOpenGL::GetQuery(lua_State*)':
C:\Users\vladms\personal\projects\spring\git.vladms\rts\Lua\LuaOpenGL.cpp:4326:5
0: error: cast from 'const void*' to 'long unsigned int' loses precision [-fperm
issive]
  GLuint q = (unsigned long int)lua_topointer(L, 1);
                                                  ^
rts\builds\legacy\CMakeFiles\engine-legacy.dir\build.make:2334: recipe for targe
t 'rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Lua/LuaOpenGL.cpp.obj' f
ailed
mingw32-make[3]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Lua/L
uaOpenGL.cpp.obj] Error 1
Post Reply

Return to “Engine”