Compiling spring (mingw and visual studio 7/8)
Moderator: Moderators
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.
please keep this thread on topic
Clean build with mingw gcc 4.1.1 works fine here
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
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.
I checked btw, and it compiles fine here with a clean mingwlibs (v5), so that isn't the issue.
Having an issue trying to compile using scons, MingW gcc 3.4.2 (DevCpp)
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
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.

edit: nevermind, renamed libdevil.a to libIL.a and all goes smoothly

huh?=sProject : 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
I installed codeblocks with the added in mingw32, then opened NTai from my old comp and tried to rebuild it and got this.
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 ==========
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:
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
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:
A workaround is to explicitly use DefaultRandomState instead of relying on the default value.
Patch:
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
}
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;\
}
I saw this note on the DirectX SDK download page:
Tools
Options
Projects and Solutions
VC++ Directories
Include (drop down box)
The place for these is in: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."
Tools
Options
Projects and Solutions
VC++ Directories
Include (drop down box)
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