That is not a problem of compilation and link , but of execution :
The .exe is bugged .
I used breakpoint to find out where is the bug , that seem to be Python :
( in base.xml.cpp , " void BaseInterface::Load( const char *filename, const char *time_of_day_hint, const char *faction " )
)
//now that we have a FILE * named inFile and a std::string named newfile we can finally begin the python
string compilefile = string( filename )+time_of_day_hint+string( faction )+BASE_EXTENSION;
Python::reseterrors();
PyRun_SimpleFile( inFile, compilefile.c_str() );
Python::reseterrors();
VSFileSystem::vs_close( inFile );
The last fonction call before the crash seem to be :
Code: Select all
void Mission::DirectorInitgame()
{
this->player_num = _Universe->CurrentCockpit();
if (nextpythonmission) {
//CAUSES AN UNRESOLVED EXTERNAL SYMBOL FOR PythonClass::last_instance ?!?!
#ifndef _WIN32
char *tmp = nextpythonmission;
while (*tmp) {
if (tmp[0] == '\r') tmp[0] = '\n';
tmp++;
}
#endif
Here is the capture of my debug screen :
I hope that will help .
EDIT : ******************************************************
I commented out the block that throw an exeption and the game launch directly
in the hangar , with the missile as vessel .
So this is a python problem , located at the end of this function :
Code: Select all
void BaseInterface::Load( const char *filename, const char *time_of_day_hint, const char *faction )
{
#if 0
std::string full_filename = string( "bases/" )+filename;
std::string daynight_filename = full_filename+"_"+string( time_of_day_hint );
full_filename += BASE_EXTENSION;
daynight_filename += BASE_EXTENSION;
std::string newfile = daynight_filename;
cout<<"BaseInterface::LoadXML "<<full_filename<<endl;
FILE *inFile = VSFileSystem::vs_open( daynight_filename.c_str(), "r" );
if (!inFile) {
newfile = full_filename;
inFile = VSFileSystem::vs_open( full_filename.c_str(), "r" );
}
if (!inFile) {
Unit *baseun = this->baseun.GetUnit();
if (baseun) {
if (baseun->isUnit() == PLANETPTR) {
daynight_filename = string( "bases/planet_" )+time_of_day_hint+string( BASE_EXTENSION );
inFile = VSFileSystem::vs_open( daynight_filename.c_str(), "r" );
newfile = daynight_filename;
if (!inFile) {
newfile = "bases/planet" BASE_EXTENSION;
inFile = VSFileSystem::vs_open( newfile.c_str(), "r" );
}
} else {
daynight_filename = string( "bases/unit_" )+time_of_day_hint+string( BASE_EXTENSION );
inFile = VSFileSystem::vs_open( daynight_filename.c_str(), "r" );
newfile = daynight_filename;
if (!inFile) {
newfile = "bases/unit" BASE_EXTENSION;
inFile = VSFileSystem::vs_open( newfile.c_str(), "r" );
}
}
}
if (!inFile)
return;
}
#else
FILE *inFile = getFullFile( string( "bases/" )+filename, time_of_day_hint, faction );
if (!inFile) {
bool planet = false;
Unit *baseun = this->baseun.GetUnit();
if (baseun)
planet = (baseun->isUnit() == PLANETPTR);
string basestring( "bases/unit" );
if (planet)
basestring = "bases/planet";
inFile = getFullFile( basestring, time_of_day_hint, faction );
if (!inFile)
return;
}
#endif
/* BUG is here !!
//now that we have a FILE * named inFile and a std::string named newfile we can finally begin the python
string compilefile = string( filename )+time_of_day_hint+string( faction )+BASE_EXTENSION;
Python::reseterrors();
PyRun_SimpleFile( inFile, compilefile.c_str() );
Python::reseterrors();
*/
VSFileSystem::vs_close( inFile );
}
PyRun_SimpleFile( inFile, compilefile.c_str() );
I will try to fix but your help will be greatly received !
I wonder if it is not a BOOST Python problem .
The vc9 solution uses Boost 1.45 but trunk/vegastrike has only Boost 1.53
I have taken then the boost 1.45 from a branch , that compile and run , but
may cause this bug ??