Revision 11783 fails to compile in Visual Studio 2003

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Revision 11783 fails to compile in Visual Studio 2003

Post by shenle »

Here is the (reduced) build log with the errors:

Build Log


------- Build started: Project: vegastrike, Configuration: Release|Win32 -------

Command Lines


Creating temporary file "d:\vegastrike\svn\vega-vc7\vegastrike_Win32_Release\RSP000001.rsp" with contents
[
/O2 /Ot /G7 /GA /I "include\\" /I "include\python\\" /I ".\\" /I "..\vegastrike\boost\1_33\\" /I "..\vegastrike\src\\" /I "..\vegastrike\vc98\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_AL" /D "HAVE_SDL" /D "YY_ALWAYS_INTERACTIVE" /D "SDL_WINDOWING" /D "HAVE_OGG" /D "HAVE_BOOST" /D "HAVE_PYTHON" /D "JPEG_SUPPORT" /D "USE_BOOST_131" /D "BOOST_PYTHON_STATIC_LIB" /D "_MBCS" /FD /EHsc /MD /arch:SSE2 /GR /YX"stdafx.h" /Fp".\vegastrike_Win32_Release/vegastrikeRVC7.pch" /Fo".\vegastrike_Win32_Release/" /Fd".\vegastrike_Win32_Release/" /FR".\vegastrike_Win32_Release/" /c /Zi /Zm500
"\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp"
]
Creating command line "cl.exe @"d:\vegastrike\svn\vega-vc7\vegastrike_Win32_Release\RSP000001.rsp" /nologo"

Output Window


Compiling...
base_interface.cpp
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : error C2146: syntax error : missing ')' before identifier 'and'
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : error C2065: 'and' : undeclared identifier
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : error C2146: syntax error : missing ';' before identifier 'filnam'
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : error C2059: syntax error : ')'
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : error C2143: syntax error : missing ';' before '{'
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(400) : warning C4552: '!=' : operator has no effect; expected operator with side-effect
\vegastrike\svn\vegastrike\src\cmd\base_interface.cpp(404) : error C2181: illegal else without matching if

Results


Build log was saved at "file://d:\vegastrike\svn\vega-vc7\vegastrike_Win32_Release\BuildLog.htm"
vegastrike - 6 error(s), 1 warning(s)



(full build log including the above errors attached)
You do not have the required permissions to view the files attached to this post.
Last edited by shenle on Thu Jan 31, 2008 5:30 am, edited 1 time in total.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Post by shenle »

The offending section of code is (starting at line 400 in base_interface.cpp):

Code: Select all

		if (filnam[0]=='#' and filnam[1]!='\0') {
			::Python::reseterrors();
			PyRun_SimpleString(const_cast<char*>(filnam));
			::Python::reseterrors();
		}else {
			/*FILE *fp=VSFileSystem::vs_open(filnam,"r");
			if (fp) {
				int length=strlen(filnam);
				char *newfile=new char[length+1];
				strncpy(newfile,filnam,length);
				newfile[length]='\0';
				::Python::reseterrors();
				PyRun_SimpleFile(fp,newfile);
				::Python::reseterrors();
				fclose(fp);
				processDelayedMissions();
			} else {
				fprintf(stderr,"Warning:python link file '%s' not found\n",filnam);
			}*/
            CompileRunPython(filnam);
		}
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

I don't know what I was thinking when coding that.
"and" is Python syntax, not C++, and I also have no clue how that managed to compile in GCC.

Try updating the subversion... I replaced that "and" with a "&&"
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Post by shenle »

Works now... compilers behave differently. I had used another machine to compile (before the update) with the Intel compiler v9.1, and I got the same errors. Guess gcc is more forgiving with syntax.
bgaskey
Elite Venturer
Elite Venturer
Posts: 718
Joined: Wed Mar 07, 2007 9:05 pm
Location: Rimward of Eden

Post by bgaskey »

its alright ace, happens to me all the time.
I can't even work in cpp because i have to replace all the ands and ors at the end and add semicolons :)
Post Reply