Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: protroll on August 26, 2008, 02:18:17 am
-
So I was trying to compile it under windows with MSVC2005 express, I believe I have almost everything that is needed to compile(DirectX SDK, Platform SDK and an installation of MSVC98(6.0) in case Platform SDK's headers are not compatible with FS2's code), but the compile failed rather miserably with 500+ errors.
It seems SDL headers are not included anywhere, and the consequences are:
1.It assumes my little endian environment as big endian, and use some mac specific instruction 'stwbrx', which caused tons of errors in inline assembler ("instruction" : [input] : [output] : [register]), not to mention __asm__ is not supported by MSVC, equivalent is _asm or __asm. I fixed this by comment out that part, since I really don't need to swap endian..
2.All SDL functions, enums, defines are undeclared.(for apparent reason)
3.Opengl enumeration 'GL_BGRA' is not included in WGL or Opengl 1.1, the equivalent is 'GL_BGRA_EXT', though SDL_Opengl defines 'GL_BGRA_EXT' as 'GL_BGRA', this shouldn't be a problem if SDL_Opengl.h is included.
A3D header is nowhere to find, so all A3D related structs, methods on those structs are errors.
Logical Errors:
1.Many parts of the code use vector->x while x is actually in a struct called 'xyz' in struct 'vector',so it should be vector->xyz.x, same for matrix's fvec etc.
2.Few C Style OOP(pointer to functions in struct) Functions passes too few parameters, the last parameter has no default value, but those functions don't pass the last parameter, e.g:
void Func(int p1, int p2, int p3, int last);
Func(1, 2, 3); //error too few parameters
void Func(int p1, int p2, int p3, int last = 1);
Func(1, 2, 3); //Fixes the problem
Weird extern keywords:
Some extern keywords are in cpp files, caused quite a few undeclared variables in various files that depends on the extern variable.
Project file is outdated:
All headers were removed from individual folders and got moved to 'include', but the project file still points to old header locations.
It's either the trunk is severely broken or I am too stupid to compile it properly :D It would be nice if there is an updated project file or at least some tips on where to get those missing A3D and headers stuff, thanks.
-
"vector" was renamed vec3d quite awhile back, and I think the xyz change occurred even before that, when Linux compatibility was added.
It sounds like you've got a mix of trunk and something else. What process did you use to get hold of the code?
-
"vector" was renamed vec3d quite awhile back, and I think the xyz change occurred even before that, when Linux compatibility was added.
It sounds like you've got a mix of trunk and something else. What process did you use to get hold of the code?
It's a clean checkout from svn://svn.icculus.org/fs2open/trunk/fs2_open to an newly-created empty folder, revision 305, I don't see how it could mix up with other codebase.
The project file I was using is from src/ called 'code'
-
yeah.. address seems about right... http://svn.icculus.org/fs2open/trunk/fs2_open/ but revision... current one is 4768
And you should be able to find Freespace2.sln from the /projects/MSVC_2005/ after you have gotten to the slightly newer revision
-
Oops I figured it out, I parsed old/wrong url 'svn://svn.icculus.org/freespace2/trunk' into tortoise when checkout the code, thanks for the help.
Maybe I am just stupid. :D