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

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

Post by imbaczek »

I'd say that understanding boost errors isn't any easier than installing gcc ^^ glad somebody figured it out.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Post by hoijui »

hello,
trying to compile spring with mingw on windows:
i used the instructions in the first post of this thread.
when i run scons configure, i get the following:

Code: Select all

scons: Reading SConscript files ...

Now configuring.  If something fails, consult `config.log' for details.

Detected platform : windows
Checking gcc version...AttributeError: 'NoneType' object has no attribute 'group':
  File "SConstruct", line 31:
    env = Environment(tools = ['mingw', 'rts'], toolpath = ['.', 'rts/build/scons'])
  File "P:\Python24\scons\SCons\Environment.py", line 266:
    apply_tools(self, tools, toolpath)
  File "P:\Python24\scons\SCons\Environment.py", line 122:
    env.Tool(tool, toolpath)
  File "P:\Python24\scons\SCons\Environment.py", line 906:
    return SCons.Tool.Tool(tool, map(self.subst, toolpath))(self)
  File "P:\Python24\scons\SCons\Tool\__init__.py", line 53:
    apply(self.generate, ( env, ) + args, kw)
  File "rts/build/scons\rts.py", line 186:
    gcc_version = config.check_gcc_version(env)
  File "rts/build/scons\config.py", line 39:
    version = re.search('[0-9]\.[0-9]\.[0-9]', version).group()
as i never used phyton so far, i am pretty slow trying to find out whats wrong.
is it possible that one needs phyton 2.5 (aswell)?
(cause i saw that it is somehow needed when compiling on linux with mingw)

Edit: same thing happens with phyton 2.5
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

do you have gcc installed and on PATH? it seems that you might not, or it's broken.

either way this needs fixing.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Post by hoijui »

it is on my path (when i run gcc or g++ i get "No input files").
...i got it!
gcc --version returns 2.95.2 for me (is the version of Dev-C++ linked to in the first post of this thread, and seems to be quite the latest).
so the regex

Code: Select all

'[0-9]\.[0-9]\.[0-9]'
cant find 2.95.2 obviously.
When i use

Code: Select all

'[0-9]\.[0-9][0-9]\.[0-9]'
it works.
i dont know how the pyhton regex works, but i guess it would be good to use something like

Code: Select all

'[0-9]*\.[0-9]*\.[0-9]*'
@tobi
I read you are the editor of rts/build/scons/config.py.
could you please adjust the regex on line 39 to accept gcc versions like 2.95.2 aswell? or whould i do a patch and submit to mantis?

..now i get further, but scons configure still doesn't get to a successfull end.
it now gets this far:

Code: Select all

....
  Guessing Python include path... mingwlibs\include\python2.4
Checking for Java...   Guessing Java include path... mingwlibs\include\java

Checking headers and libraries
Checking for C++ header file GL/gl.h... no
Could not find one of these headers: ['GL/gl.h']
Checking for C++ header file GL/glew.h... no
Could not find one of these headers: ['GL/glew.h']
Checking for C++ header file GL/glu.h... no
Could not find one of these headers: ['GL/glu.h']
Checking for C++ header file IL/il.h... no
Could not find one of these headers: ['IL/il.h']
Checking for C++ header file IL/ilu.h... no
Could not find one of these headers: ['IL/ilu.h']
Checking for C++ header file SDL/SDL.h...
SDL/SDL.h is in mingwlibs/include, like all the ones before, so it should be found.

Edit: woops! :D it sais "no"...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Post by hoijui »

the log file (config.log) shows the errors, i shortened it a bit (lines consisting of only "...")

Code: Select all


file P:\Python24\scons\SCons\Environment.py,line 1019:
	Configure( confdir = build\sconf_temp )

Checking for C++ header file GL/gl.h... build\sconf_temp\conftest_0.cpp <- 
  |
  |#include "GL/gl.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_0.o build\sconf_temp\conftest_0.cpp
cc1plus: Invalid option `fpmath=387'
cc1plus: Invalid option `-fsingle-precision-constant'
cc1plus: Invalid option `-frounding-math'
cc1plus: Invalid option `-fsignaling-nans'
In file included from build\sconf_temp\conftest_0.cpp:2:
P:\Dev-C++\include\GL\gl.h:1135: syntax error before `void'
...
P:\Dev-C++\include\GL\gl.h:1498: parse error before `*'
scons: *** [build\sconf_temp\conftest_0.o] Error 1
no
Failed program was:
1: 
2: #include "GL/gl.h"
3: 
Error message: failed to compile test program
Checking for C++ header file GL/glew.h... build\sconf_temp\conftest_1.cpp <- 
  |
  |#include "GL/glew.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_1.o build\sconf_temp\conftest_1.cpp
cc1plus: Invalid option `fpmath=387'
cc1plus: Invalid option `-fsingle-precision-constant'
cc1plus: Invalid option `-frounding-math'
cc1plus: Invalid option `-fsignaling-nans'
scons: *** [build\sconf_temp\conftest_1.o] Error 1
no
Failed program was:
1: 
2: #include "GL/glew.h"
3: 
Error message: failed to compile test program
Checking for C++ header file GL/glu.h... build\sconf_temp\conftest_2.cpp <- 
  |
  |#include "GL/glu.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_2.o build\sconf_temp\conftest_2.cpp
cc1plus: Invalid option `fpmath=387'
cc1plus: Invalid option `-fsingle-precision-constant'
cc1plus: Invalid option `-frounding-math'
cc1plus: Invalid option `-fsignaling-nans'
In file included from P:\Dev-C++\include\GL\glu.h:22,
                 from build\sconf_temp\conftest_2.cpp:2:
P:\Dev-C++\include\GL\gl.h:1135: syntax error before `void'
...
P:\Dev-C++\include\GL\gl.h:1498: parse error before `*'
In file included from build\sconf_temp\conftest_2.cpp:2:
P:\Dev-C++\include\GL\glu.h:61: syntax error before `('
...
P:\Dev-C++\include\GL\glu.h:563: syntax error before `('
scons: *** [build\sconf_temp\conftest_2.o] Error 1
no
Failed program was:
1: 
2: #include "GL/glu.h"
3: 
Error message: failed to compile test program
Checking for C++ header file IL/il.h... build\sconf_temp\conftest_3.cpp <- 
  |
  |#include "IL/il.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_3.o build\sconf_temp\conftest_3.cpp
cc1plus: Invalid option `fpmath=387'
cc1plus: Invalid option `-fsingle-precision-constant'
cc1plus: Invalid option `-frounding-math'
cc1plus: Invalid option `-fsignaling-nans'
scons: *** [build\sconf_temp\conftest_3.o] Error 1
no
Failed program was:
1: 
2: #include "IL/il.h"
3: 
Error message: failed to compile test program
Checking for C++ header file IL/ilu.h... build\sconf_temp\conftest_4.cpp <- 
  |
  |#include "IL/ilu.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_4.o build\sconf_temp\conftest_4.cpp
cc1plus: Invalid option `fpmath=387'
cc1plus: Invalid option `-fsingle-precision-constant'
cc1plus: Invalid option `-frounding-math'
cc1plus: Invalid option `-fsignaling-nans'
scons: *** [build\sconf_temp\conftest_4.o] Error 1
no
Failed program was:
1: 
2: #include "IL/ilu.h"
3: 
Error message: failed to compile test program
Checking for C++ header file SDL/SDL.h... build\sconf_temp\conftest_5.cpp <- 
  |
  |#include "SDL/SDL.h"
  |
  |
g++ -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -mfpmath=387 -mthreads -DNDEBUG -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Imingwlibs\include -IP:\Dev-C++\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java -c -o build\sconf_temp\conftest_5.o build\sconf_temp\conftest_5.cpp
if i use the same compile commands but without

Code: Select all

-fsingle-precision-constant
-frounding-math
-fsignaling-nans
-mfpmath=387
, then the ones failing with "Error 1" in the config file, work.
gl.h is taken from C:/Dev-C++/Include/GL/gl.h.
the line 1135, which contains the first syntax error as seen above, looks like this:

Code: Select all

WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
the others containing syntax errors look similar.

any ideas?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

You should just update your gcc. There are other issues with old versions anyway.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Post by hoijui »

..aehmm...
sorry! :/
yeah.. i used an old version of Dev-C++ (dont know how i managed to do that but i did)
problem solved
sorry again!
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Streflop didn't build here because of
status = os.system("make " + cmd)
It's because make isn't recognized as the mingw tool is called mingw32-make in older releases.


edit: Okay, old bug is old, sorry. :oops:

After installing msys and adding the path to it's bin folder to %PATH% I managed to build streflop finally. Make basically needs rm to function properly which comes with msys. Comes with make too, but I used a batch file as workaround (@mingw32-make %*).

http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe

I was using a candidate install of the MinGW 5.1.3 package.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Code: Select all

rts\rendering\gl\mygl.h(7) : fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
Why on earth do I need openGL stuff to compile an AI in svn? NTai does not use glew, and I cant figure out where the spring headers are #include ing mygl.h
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

rts/Game/PreGame.cpp, rts/Game/GameSetup.cpp?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Theyre not a part of the AI spring headers. They arent included in any I projects either.

I am not getting this error from compiling spring (although I might do if I tried), I am getting it from compiling NTai. I had not changed NTai between the last time I got it to compile and when I did an svn checkout and compiled a few minutes ago.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

AICallback.cpp
#include "Game/Camera.h"
Camera.h
#include "Rendering/GL/myGL.h"
I assume AI callbacks are being included by you... though someone with some more knowledge should investigate this.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

IAICalback.h is included.

Found it!

#include "Rendering/GL/myGL.h"
line 8 of unitdef.h, wtf is something like that doing in there?!

...

Code: Select all

GLuint unitimage; // don't read this directly use CUnitDefHandler::GetUnitImage instead
erm maybe this should be stored somewhere else? I'm not so sure this should belong here regardless of wether its an OpenGL type.

Ontop of that its type might differ between Operating systems and implementations, could that cause hash issues and thus sync issues? I'm not quite sure how the sync setup works but if things are of different data types... That and this is a class hat should be synced, having machine specific values should go in an unsynced class structure.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

A GLunit stores a texture index (for example). Where else would you store that?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well its unsynced data in a class that was created to store synced data.

And if you haven't noticed it completely and utterly breaks AIs. AIs do not use Open GL. They have no need for Open GL headers. This needs correcting immediately.

If there is no alternative storage class then create one.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

So am I going to have to start using glew as a dependency for NTai?!?!?!? pfft, this is stupid. No wonder people complain springs source is like spaghetti
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

mingwlibs package updated
Image
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

updated again, boost 1.34, added wx, downgraded freetype
Image
zyzy
Posts: 57
Joined: 27 Jan 2006, 22:40

Post by zyzy »

i am noob in compiling spring, not in games BA, AA ;)

On windows with mingw
is it normal that i have to copy scons.bat from C:\Python25\Scripts to C:\Python25\ ???
Is it because last version of python?
thx,

There is a lot of link in JC post are not updated.
Is possible to move the post to wiki like developpements links thread?
Then it could be upgraded from everyones.

need to have link to versions without focus on a version.
I hope Spring follow the tools versions.

Just a suggest.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Yeah, I was going to do that.

So here it is:
http://spring.clan-sy.com/wiki/Source_D ... nvironment

Rewritten/merged/updated/combined etc. :-)
Post Reply

Return to “Engine”