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

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
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

No, I have single core (and quite old) CPU.
I still have no idea what caused the problem, but at least I know how to fix it if it happens again...

Edit:
The problem started to happen again. I commented out building streflop in SConstruct file (cause i have it compiled already) and it works fine now.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

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

Post by LordMatt »

-j4 for quad. ;)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

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

Post by jK »

Do you have Delphi installed?
Me did and it has its own make.exe and also puts it in PATH.
So a tip for other ppl:

If you get and error that the commandline params "--no-print-directory" & "-C" aren't supported and you can't compile streflop, then make sure that you remove Delphi from your PATH variable.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

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

Post by Rafal99 »

Yes, i have Delphi installed. I removed all Delphi folders from my PATH variable, but still no effect...

Btw error i am getting is not:
the commandline params "--no-print-directory" & "-C" aren't supported
but:

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!
Actually the best solution i found is commenting out "env.Exit(1)" line in SConstruct to prevent it from exiting if streflop build fails, so i can still compile Spring when it happens.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

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

Post by bibim »

I was taking a look at the building options in the rts.py file, and I believe that the following debugdefines help string (line 90):

Code: Select all

('debugdefines', 'Set to no to suppress DEBUG and _DEBUG preprocessor #defines (use to add symbols to release build)', True),
is inconsistent with the following code (line 260):

Code: Select all

if not args.has_key('debugdefines') or not args['debugdefines']:
  env.AppendUnique(CPPDEFINES=['DEBUG', '_DEBUG'])
else:
  env.AppendUnique(CPPDEFINES=['NDEBUG'])
Or maybe I didn't get it...
zyzy
Posts: 57
Joined: 27 Jan 2006, 22:40

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

Post by zyzy »

hi,
scons can't find mingwlibs ???
any ideas?
Image
Image[/img]

Code: Select all

Checking for C++ header file boost/cstdint.hpp... yes
Checking for C++ header file boost/regex.hpp... yes
Checking for C library boost_regex-gcc-mt... no
Checking for C library boost_regex-mt... no
Checking for C library boost_regex-gcc... no
Checking for C library boost_regex... no
Could not find one of these libraries: ['boost_regex-gcc-mt', 'boost_regex-mt', 'boost_regex-gcc', 'b

Code: Select all

scons: Configure: Checking for C library boost_regex-gcc-mt... 
build\sconf_temp\conftest_2.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
gcc -o build\sconf_temp\conftest_2.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_2.c
gcc -o build\sconf_temp\conftest_2.exe -mwindows build\sconf_temp\conftest_2.o -Lrts\lib\streflop -Lmingwlibs\lib -LE:\Dev-Cpp\lib -lboost_regex-gcc-mt
E:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lboost_regex-gcc-mt
collect2: ld returned 1 exit status
scons: Configure: no
edit:dev-cpp, python 2.5.2, pywin 210 fo py2.5, scons0.98.3, mingwlibsV10
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

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

Post by bibim »

zyzy wrote:

Code: Select all

scons: Configure: Checking for C library boost_regex-gcc-mt... 
build\sconf_temp\conftest_2.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
gcc -o build\sconf_temp\conftest_2.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_2.c
gcc -o build\sconf_temp\conftest_2.exe -mwindows build\sconf_temp\conftest_2.o -Lrts\lib\streflop -Lmingwlibs\lib -LE:\Dev-Cpp\lib -lboost_regex-gcc-mt
E:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lboost_regex-gcc-mt
collect2: ld returned 1 exit status
scons: Configure: no
Can you paste what is just after this ?
zyzy
Posts: 57
Joined: 27 Jan 2006, 22:40

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

Post by zyzy »

file is here:
http://www.imageshack.us/?pickup=80118533731066

Code: Select all

file E:\projects\spring\trunk\rts\build\scons\config.py,line 332:
	Configure(confdir = build\sconf_temp)
scons: Configure: Checking for C++ header file boost/cstdint.hpp... 
build\sconf_temp\conftest_0.cpp <-
  |
  |#include "boost/cstdint.hpp"
  |
  |
g++ -o build\sconf_temp\conftest_0.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_0.cpp
scons: Configure: yes

scons: Configure: Checking for C++ header file boost/regex.hpp... 
build\sconf_temp\conftest_1.cpp <-
  |
  |#include "boost/regex.hpp"
  |
  |
g++ -o build\sconf_temp\conftest_1.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_1.cpp
scons: Configure: yes

scons: Configure: Checking for C library boost_regex-gcc-mt... 
build\sconf_temp\conftest_2.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
gcc -o build\sconf_temp\conftest_2.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_2.c
gcc -o build\sconf_temp\conftest_2.exe -mwindows build\sconf_temp\conftest_2.o -Lrts\lib\streflop -Lmingwlibs\lib -LE:\Dev-Cpp\lib -lboost_regex-gcc-mt
E:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lboost_regex-gcc-mt
collect2: ld returned 1 exit status
scons: Configure: no

scons: Configure: Checking for C library boost_regex-mt... 
build\sconf_temp\conftest_3.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
scons: Configure: no

scons: Configure: Checking for C library boost_regex-gcc... 
build\sconf_temp\conftest_4.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
scons: Configure: no

scons: Configure: Checking for C library boost_regex... 
build\sconf_temp\conftest_5.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
scons: Configure: no

scons: Configure: Checking for C++ header file boost/serialization/split_member.hpp... 
build\sconf_temp\conftest_6.cpp <-
  |
  |#include "boost/serialization/split_member.hpp"
  |
  |
g++ -o build\sconf_temp\conftest_6.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_6.cpp
scons: Configure: yes

scons: Configure: Checking for C++ header file boost/thread.hpp... 
build\sconf_temp\conftest_7.cpp <-
  |
  |#include "boost/thread.hpp"
  |
  |
g++ -o build\sconf_temp\conftest_7.o -c -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -fsingle-precision-constant -frounding-math -fsignaling-nans -mieee-fp -O2 -pipe -fno-strict-aliasing -finline-functions -funroll-loops -mfpmath=387 -mthreads -D_REENTRANT -D_SZ_ONE_DIRECTORY -Irts -Irts\System -Irts\lib\luabind -Irts\lib\lua\include -Irts\lib\streflop -Imingwlibs\include -IE:\Dev-Cpp\include -Imingwlibs\include\freetype2 -Imingwlibs\include\SDL -Imingwlibs\include\ogg -Imingwlibs\include\vorbis -Imingwlibs\include\python2.5 -Imingwlibs\include\python2.4 -Imingwlibs\include\java build\sconf_temp\conftest_7.cpp
scons: Configure: yes

scons: Configure: Checking for C library boost_thread-gcc-mt... 
build\sconf_temp\conftest_8.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
scons: Configure: no
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

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

Post by bibim »

I had exactly the same problem with the scons version (v0.98.3.r2928) coming with Debian testing release (lenny), whereas it used to work with the scons (v0.96) coming with Debian stable release (etch).

Which scons version are you using ?

I didn't investigate very much, but 2 workarounds worked for me, maybe it will help you:

1) changing the search order for boost libraries in config.py so that it looks for the good ones first. In my case I replaced

Code: Select all

                if gcc: boost.libraries = [l+'-gcc-mt', l+'-mt', l+'-gcc', l]
                else:   boost.libraries = [l+'-mt', l]
by

Code: Select all

boost.libraries = [l+'-mt', l]
2) downgrading scons
zyzy
Posts: 57
Joined: 27 Jan 2006, 22:40

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

Post by zyzy »

I use win xp
1)it works with replaced:

Code: Select all

                if gcc: boost.libraries = [l+'-gcc-mt', l+'-mt', l+'-gcc', l]
                else:   boost.libraries = [l+'-mt', l]
by

Code: Select all

boost.libraries = [l+'-mt', l]
It's strange, others problems with others libraries have gone with this modification.
don't understand by reading the script.

2) it didn't need to downgrade scons
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

bibim wrote:I was taking a look at the building options in the rts.py file, and I believe that the following debugdefines help string (line 90):

Code: Select all

('debugdefines', 'Set to no to suppress DEBUG and _DEBUG preprocessor #defines (use to add symbols to release build)', True),
is inconsistent with the following code (line 260):

Code: Select all

if not args.has_key('debugdefines') or not args['debugdefines']:
  env.AppendUnique(CPPDEFINES=['DEBUG', '_DEBUG'])
else:
  env.AppendUnique(CPPDEFINES=['NDEBUG'])
Or maybe I didn't get it...
Hmm it seems wrong indeed. debugdefines=no is ment to make it #define NDEBUG, not DEBUG + _DEBUG.

I've put it on my todo list to look at it.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

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

Post by bibim »

zyzy wrote:1)it works [...]
It's strange, others problems with others libraries have gone with this modification.
don't understand by reading the script.
They've gone because they were false problems (if you check your log file you will see that it wasn't even trying to compile the other checks after the first fail)... I think this is due to an incompatibility between spring build script and some scons versions...
zyzy wrote:2) it didn't need to downgrade scons
Yeah you don't need to do both, these are 2 independent workarounds.
zelta
Posts: 1
Joined: 15 May 2008, 02:10

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

Post by zelta »

Using svn Revision: 5890
Trying to compile with MSVC (2005), I get this:

Code: Select all

>Game.cpp
1>\trunk\rts\Map/Ground.h(31) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/Ground.h(31) : error C2059: syntax error : '::'
1>\trunk\rts\Map/Ground.h(31) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/Ground.h(31) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/Ground.h(32) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/Ground.h(32) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/Ground.h(32) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/ReadMap.h(73) : error C2589: '(' : illegal token on right side of '::'
1>\trunk\rts\Map/ReadMap.h(73) : error C2059: syntax error : '::'
1>\trunk\rts\Rendering/Textures/nv_dds.h(337) : error C2146: syntax error : missing ';' before identifier '__glewTexImage3D'
1>\trunk\rts\Rendering/Textures/nv_dds.h(337) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(337) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(337) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(338) : error C2146: syntax error : missing ';' before identifier 'glCompressedTexImage1DARB'
1>\trunk\rts\Rendering/Textures/nv_dds.h(338) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(338) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(338) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(339) : error C2146: syntax error : missing ';' before identifier 'glCompressedTexImage2DARB'
1>\trunk\rts\Rendering/Textures/nv_dds.h(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\trunk\rts\Rendering/Textures/nv_dds.h(340) : error C2146: syntax error : missing ';' before identifier 'glCompressedTexImage3DARB'
1>\trunk\rts\Rendering/Textures/nv_dds.h(340) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\
That is just the first set of errors, there are others that look similar.

Can someone help with this? :cry:
zyzy
Posts: 57
Joined: 27 Jan 2006, 22:40

scons version

Post by zyzy »

bibim wrote:
zyzy wrote:1)it works [...]
It's strange, others problems with others libraries have gone with this modification.
don't understand by reading the script.
They've gone because they were false problems (if you check your log file you will see that it wasn't even trying to compile the other checks after the first fail)... I think this is due to an incompatibility between spring build script and some scons versions...
zyzy wrote:2) it didn't need to downgrade scons
Yeah you don't need to do both, these are 2 independent workarounds.
It could be good to fix it, to work with lasts versions (python,pywin,scons), and links in the wiki are on lasts versions.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

Another streflop problem:

Code: Select all

J:\Spring Code\trunk\trunk>scons
scons: Reading SConscript files ...
make -C libm
make[1]: Nothing to be done for `all'.
rm -f streflop.a
process_begin: CreateProcess(NULL, rm -f streflop.a, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [streflop.a] Error 2
mingw32-make -C libm
mingw32-make[1]: Nothing to be done for `all'.
rm -f streflop.a
process_begin: CreateProcess(NULL, rm -f streflop.a, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [streflop.a] Error 2
Failed building streflop!
This is with a brand new SVN checkout.


EDIT: Old bug is even older. Rattle fixed this a few pages back by installing MSys. :oops: Perhaps the wiki should be updated.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

FYI, to compile using Visual Studio 2008 you MUST install this hotfix:

http://support.microsoft.com/kb/946040

There may be other stuff that's broken but I'll fix that asap since my most powerful machine now has VS 2008 :-)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

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

Post by hoijui »

I upgraded my Ubuntu to Hardy. The mingw release it uses is 4.2.1 (before the upgrade, it was 3.4). i think i remember that tobi said something like gcc 4 is needed anyway for some new stuff...
so is there a plan to switch to mingw 4?

as on windows we use the latest Dev-Cpp (beta) already, which comes with mingw 3.4, we would have to use mingw directly which is a little harder to setup, right?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

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

Post by imbaczek »

don't use dev-cpp, it's ancient. use code::blocks.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

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

Post by Kloot »

Spring releases are cross-compiled with mingw32 4.2 already.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

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

Post by Auswaschbar »

Does have someone tried to cross-compile spring with gcc 4.3.1? It didn't work here because it always fails due to boost errors (maybe upgrade to 1.35?).
Post Reply

Return to “Engine”