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

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
monohouse

Post by monohouse »

maybe that's the problem, I may have built with a debug=no
Last edited by monohouse on 11 Jan 2007, 22:06, edited 2 times in total.
monohouse

Post by monohouse »

THIS is the error I get when

Code: Select all

scons configure cpppath=D:\mingw\lib\gcc\mingw3
2\4.2.0\include\c++ optimize=no debug=no
Last edited by monohouse on 13 Jan 2007, 14:32, edited 4 times in total.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

please keep this thread on topic

Clean build with mingw gcc 4.1.1 works fine here

Code: Select all

C:\taspring_trunk>scons configure debug=yes optimize=yes cpppath=C:\mingw\lib\gcc\mingw32\4.1.1\include\c++
C:\taspring_trunk>scons
monohouse

Post by monohouse »

yeha I think it does compile sorry about that, it appears that spring.exe compiles fine, the AI stuff are the ones that don't compile.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Michilus, which mingw/gcc version?

monohouse: strange. They do build fine here...
monohouse

Post by monohouse »

maybe it is possible to include spring-mingwlibs already inside the spring directory so that you could avoid errors like those, and have your own fixed version of the packages, which always match the version.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

You mean in SVN? Hell no, there's enough bloat in it already. it really doesn't make sense to version generated data (ie. executables/dlls etc.) or external things, it just slows down development by increasingn the time for a checkout.

I checked btw, and it compiles fine here with a clean mingwlibs (v5), so that isn't the issue.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Having an issue trying to compile using scons, MingW gcc 3.4.2 (DevCpp)

Code: Select all

blah blah blah... -LC:\Dev-Cpp\bin\lib -lopengl32 -lg
lu32 -lz -lfreetype -lpython24 -lglew32 -lboost_thread-mt -lboost_regex-mt -lIL
-limagehlp -ldsound -lgdi32 -lwinmm -lwsock32 -lole32 -lmingw32 -lSDLmain -lSDL
-lstreflop
C:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot f
ind -lIL
collect2: ld returned 1 exit status
scons: *** [game\spring.exe] Error 1
scons: building terminated because of errors.
Latest mingwlibs package, current SVN. (I have compiled previously, though that was a while back, ~0.72 iirc) :(

edit: nevermind, renamed libdevil.a to libIL.a and all goes smoothly :-)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Project : NTai DLL
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Users\Tom\Documents\Development\JLobby\ntaiCodeblocks\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: ..\..\taspring\spring_folder\AI\AFC\grid\CGridCell.cpp
mingw32-g++.exe: installation problem, cannot exec `cc1plus': No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
huh?=s

I installed codeblocks with the added in mingw32, then opened NTai from my old comp and tried to rebuild it and got this.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Do you have a cc1plus.exe in the path? If not, do you have a cc1plus.exe at all? If not, are you sure you installed the C++ compiler (and not just C)? (doesn't apply to all available mingw installers)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

mingw5.13 installer doesnt install it either, nor does codeblocks. This is also true of codeblocks on XP, as lindir the green zipped his install up and his didnt have the file, nor does my old XP install have it, it seems to be a Windows Vista specific flaw.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Compiling spring in Visual Studio 2005 with Visual studio sp1

Code: Select all

1>------ Build started: Project: rts, Configuration: Release Win32 ------
1>Compiling...
1>StdAfx.cpp
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(193) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(193) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(193) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(194) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(194) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(194) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(194) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(197) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(197) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(197) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>c:\users\tom\documents\development\taspring\spring_folder\rts\lib\streflop\Random.h(197) : error C2440: 'default argument' : cannot convert from 'streflop::RandomState *__w64 ' to 'streflop::RandomState &'
1>Build log was saved at "file://c:\Users\Tom\Documents\Development\taspring\spring_folder\rts\build\vstudio8\Release\BuildLog.htm"
1>rts - 11 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

This also happens if I try to convert the Visual studio 2003 project and compile it in 2005.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I don't see why it invents this __w64 pointer, I don't see any RandomState pointers in that file, definitely not in the default arguments...

Maybe I didn't look long enough tho.

Try commenting out the offending lines, it might just work since the functions there aren't used in Spring AFAIK.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I commented it out and it started compiling.

First of all it complained it couldnt find LIBC.lib so I told it to ignore that and now I get the following:

Code: Select all

1>streflop_gateway.obj : error LNK2019: unresolved external symbol "float __cdecl streflop::Random<1,0,float>(float,float,struct streflop::RandomState &)" (??$Random@$00$0A@M@streflop@@YAMMMAAURandomState@0@@Z) referenced in function _streflop_random
1>Random.obj : error LNK2001: unresolved external symbol "float __cdecl streflop::Random<1,0,float>(float,float,struct streflop::RandomState &)" (??$Random@$00$0A@M@streflop@@YAMMMAAURandomState@0@@Z)
1>../../../game/spring.exe : fatal error LNK1120: 1 unresolved externals
zizu
Posts: 14
Joined: 12 Jun 2006, 01:51

Post by zizu »

I also had the same problem and it├óÔé¼Ôäós a bug in visual studio 2005 that makes it choke on template specialization with a reference as the default parameter.

Example:

Code: Select all

template<bool B>
void foo(const int& state = 5);


template<> 
void foo<true>(const int& state){}


int main(){
	foo<true>();//Compiler bug
	//foo<true>(5);//Workaround 
}
A workaround is to explicitly use DefaultRandomState instead of relying on the default value.

Patch:

Code: Select all

Index: rts/lib/streflop/Random.h
===================================================================
--- rts/lib/streflop/Random.h	(revision 3401)
+++ rts/lib/streflop/Random.h	(working copy)
@@ -174,19 +174,19 @@
 template<> a_type Random<a_type>(RandomState& state); \
 template<> inline a_type Random<true, true, a_type>(a_type min, a_type max, RandomState& state) { \
     a_type range = max - min;\
-    return Random12<true,true,a_type>() * range - range + min;\
+    return Random12<true,true,a_type>(DefaultRandomState) * range - range + min;\
 } \
 template<> inline a_type Random<true, false, a_type>(a_type min, a_type max, RandomState& state) { \
     a_type range = max - min;\
-    return Random12<true,false,a_type>() * range - range + min;\
+    return Random12<true,false,a_type>(DefaultRandomState) * range - range + min;\
 } \
 template<> inline a_type Random<false, true, a_type>(a_type min, a_type max, RandomState& state) { \
     a_type range = max - min;\
-    return Random12<false,true,a_type>() * range - range + min;\
+    return Random12<false,true,a_type>(DefaultRandomState) * range - range + min;\
 } \
 template<> inline a_type Random<false, false, a_type>(a_type min, a_type max, RandomState& state) { \
     a_type range = max - min;\
-    return Random12<false,false,a_type>() * range - range + min;\
+    return Random12<false,false,a_type>(DefaultRandomState) * range - range + min;\
 }
 
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I'm getting errors about missing dsound.h. The scons configure finds dsound but during the compile it bails out at the sound system with "dsound.h not found".
User avatar
QMan
Posts: 103
Joined: 17 Feb 2006, 01:10

Post by QMan »

I saw this note on the DirectX SDK download page:
If you encounter compilation issues related to the DirectX headers, make sure that the include directories in Visual Studio are set correctly. On the Win32 platform, make sure that there is a reference to the DirectX headers. Either "$(DXSDK_DIR)include" or "c:\program files\microsoft DirectX SDK (February 2007)\Include" should appear in the include directory "$(VCInstallDir)Include."
The place for these is in:

Tools
Options
Projects and Solutions
VC++ Directories
Include (drop down box)
User avatar
QMan
Posts: 103
Joined: 17 Feb 2006, 01:10

Post by QMan »

Getting error about a missing CrashRpt.h file.

Code: Select all

#ifdef WIN32
	#ifdef __MINGW32__
		#include "Platform/Win/CrashHandler.h"
	#else
		#include "CrashRpt.h"
		#pragma comment(lib,"../../../CrashRpt/lib/CrashRpt.lib")
	#endif
	#include "Platform/Win/win32.h"
	#include <winreg.h>
	#include <direct.h>
#endif // WIN32
User avatar
QMan
Posts: 103
Joined: 17 Feb 2006, 01:10

Post by QMan »

So I found the CrashRpt stuff in the b2 source, but the b3 source is missing that whole directory.
Post Reply

Return to “Engine”