Jump to content

Home

Compiling OJP Enhanced in Visual C++ Express


Sushi_CW

Recommended Posts

First, a disclaimer: I've only tried to get it to work on my computer. I can make no guarantees. :) Also, I got it set up a while ago, and I'm not about to demolish everything and start from scratch just for the purposes of a more complete tutorial. So, I may be forgetting something (but hopefully not). :) If anyone notices anything I've missed, post away!

 

Here's what to do:

 

1. Get the source. The "Accessing the OJP source" thread explains how to do this.

 

2. Install Visual C++ Express.

 

3. Install the LATEST version of the Windows Platform SDK (Microsoft ® Windows Server® 2003 R2 Platform SDK - March 2006 Edition).

Link here.

I uninstalled the previous SDK version that I had: you might need to do the same.

 

4. Open Visual C++ Express. Go to Tools->Options.

 

5. In the options menu, go to "Projects and Solutions", then under that, click on "VC++ Directories". I don't know how much of this will already be set up with a clean version of VC++ Express: I did it a long time ago. However, you will at least need to add the directories for the SDK. As an example, I'll include what I currently have in those directories. The only categories that should matter are Include and Library.

 

Directories for include files:

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc

$(VCInstallDir)include

$(VCInstallDir)PlatformSDK\include

$(FrameworkSDKDir)include

 

Directories for library files:

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib

$(VCInstallDir)lib

$(VCInstallDir)PlatformSDK\lib

$(FrameworkSDKDir)lib

$(VSInstallDir)

$(VSInstallDir)lib

 

6. Open the main Enhanced solution. It should be located in OJP/Basic/source.

 

7. Cross your fingers and hit "Build Solution." Hopefully, it will work! If not, post the error(s) you got and we'll see where we can go from there.

Link to comment
Share on other sites

well, I followed the directions and tried to compile. No luck. I got thousands of errors so obviously its not reading what its suppose to. I wasn't entirely sure what you meant by "main Enhanced solution" but I assumed you meant "OJP Enhanced [VC++ Intellisense Database]." In the Solution Explorer I have the following listed: Under "Solution 'OJP Enhanced (4 projects)" there is + botlib + JK2cgame + JK2game + ui + Solution Items (unavailable).

 

I hope that tells you something about what might be wrong, because I have no idea. Maybe I should have crossed my fingers. LOL. Thanks for making this tutorial btw.

Link to comment
Share on other sites

You don't have one that's just "Ojp Enhanced.sln"? That's odd. You should have the .old one as well, but it isn't the one you use... if you can't find the file, maybe try getting a clean copy of the repository?

 

I might have to do that although it is fairly new. Maybe its because I download the whole raw code everytime without doing the tortise or other CVS stuff. I'll let you know what I find.

Link to comment
Share on other sites

I tried opening an Enhanced sln that Vruki gave me, but it wouldnt compile either. Although, I got a messege when I opened that said "solution folders are not supported in this version of visual studio. Solution folders 'solution Items' will be displayed as unavailable." Does that help?

Link to comment
Share on other sites

I get that message too. Ignore it, it doesn't affect your ability to compile. It sounds like you're closer though. :) If you could post some of the errors you get when you try to compile (just a sample) than it would probably help a lot.

Link to comment
Share on other sites

I use Express at home and Professional at work, and they both seem reasonably quick to me. I doubt you'll find Express to be substantially faster than Professional or Standard or whatever you have, but it may be worth a try. :)

 

You might also want to check out CodeBlocks. It's much lighter than Visual Studio, cross-platform, and works with a number of C/C++ compilers (including Microsoft's). I'm eagerly awaiting their next release build.

Link to comment
Share on other sites

Heres the first string of errors I get:

 

------ Build started: Project: ui, Configuration: Debug Win32 ------

Compiling...

ui_syscalls.c

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2018: unknown character '0x7f'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ')' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ';' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2061: syntax error : identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2059: syntax error : ')'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(405) : error C2059: syntax error : '}'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2059: syntax error : ';'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C3409: empty attribute block is not allowed

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2143: syntax error : missing ']' before 'constant'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(704) : error C2059: syntax error : '}'

ui_shared.c

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2018: unknown character '0x7f'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ')' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ';' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2061: syntax error : identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2059: syntax error : ')'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(405) : error C2059: syntax error : '}'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2059: syntax error : ';'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C3409: empty attribute block is not allowed

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2143: syntax error : missing ']' before 'constant'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(704) : error C2059: syntax error : '}'

ui_saber.c

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2018: unknown character '0x7f'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ')' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ';' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2061: syntax error : identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2059: syntax error : ')'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(405) : error C2059: syntax error : '}'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2059: syntax error : ';'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C3409: empty attribute block is not allowed

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2143: syntax error : missing ']' before 'constant'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(704) : error C2059: syntax error : '}'

ui_main.c

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2018: unknown character '0x7f'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ')' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2146: syntax error : missing ';' before identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2061: syntax error : identifier 't'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(375) : error C2059: syntax error : ')'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(405) : error C2059: syntax error : '}'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2059: syntax error : ';'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C3409: empty attribute block is not allowed

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(418) : error C2143: syntax error : missing ']' before 'constant'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'

g:\documents and settings\john\desktop\basic\source\game\bg_vehicles.h(704) : error C2059: syntax error : '}'

Build log was saved at "file://g:\Documents and Settings\John\Desktop\Basic\source\Debug\ui\BuildLog.htm"

ui - 48 error(s), 0 warning(s)

 

There is alot more where this comes from, I just stopped the compiler so it would be too long.

Link to comment
Share on other sites

Thanks Sushi.

 

JR, syntax error means there're characters out of place in the code. It looks like it doesn't like character "0x7f" whatever that is. Are you using some internationalized font or keyboard?

 

What does line 375 of bg_vehicles.h look like?

Link to comment
Share on other sites

Thanks Sushi.

 

JR, syntax error means there're characters out of place in the code. It looks like it doesn't like character "0x7f" whatever that is. Are you using some internationalized font or keyboard?

 

What does line 375 of bg_vehicles.h look like?

 

Don't worry I know what syntex errors mean. The problem is that this is without any changes to the code direct from the respository. Obviously its not reading the files its suppose to.

Link to comment
Share on other sites

There is a character in there with ASCII value 127. You likely can't see it, it's probably not printing. It's deadly. Find it. Get rid of it.

 

Do lines 373 through 375 look like this?:

 


// Initialize the vehicle (should be called by Spawn?).
qboolean (*Initialize)( Vehicle_t *pVeh );

 

with 373 being blank, 374 that comment and 375 that line of code? The evil character is somewhere before the "t" in "Vehicle_t." There's a chance that it's in line 372 after the semicolon at the end of the sentence too. But I don't think it's before there or else the line number in the error would be lower than 375.

 

Try deleting all characters between the end of line 372 and that "t", even the whitespace, and retyping the code on line 375 by hand.

 

-------------------

 

You could also try to search the text for the character. Bring up the find dialog and while holding ALT down type 0127 into the input place. Search for it. If you don't find it it might be some other non-printing character in the range from 227 to 255. Likely ASCII 160 or 173.

Link to comment
Share on other sites

Well, I might give it a try, but shouldnt this just compile the way it is? I haven't made any changes to it since I downloaded it and it compiled just fine for sushi. Since razor would not have sent a very badly broken set of code to the repository, I'm pretty sure this is just a file or program misunderstanding and not any kind of actual syntex error (s).

 

Keep in mind that I have listed only the first couple seconds of compilation. If I hadn't stopped the compiler myself and posted everything that would have ended up in the compile log, it would be thousand of lines long and probably at least a thousand or more different errors. At least thats what happened when I let the compile log run completely before. Heck I even went and got a cup of coffee at the coffee shop I was at and when I came back, the log was still running and listing errors. LOL

Link to comment
Share on other sites

I actually did see a few errors like that at one point, but managed to get rid of them somehow without modifying any code. The thing is, I don't remember doing anything that I haven't already listed.

 

And Vruki, you might be interested to know: I checked the memory footprints used by Visual Studio using Professional at work and Express at home. Like I said, they both run plenty fast for me, but it turns out that Express has a much smaller memory footprint: it takes 50mb, while Professional usually takes close to 200mb. It looks like the memory footprint for Express is much smaller after all.

Link to comment
Share on other sites

Thanks again Sushi. & the problem is also, I suspect, a memory leak. But I want JR to get it compiled first before I even think about using Express. He's my guinea pig lol! ;)

 

JR, the devs of Express and equivalent versions of msvc might have monkeyed around with the way it deals with characters higher than 126. There are security issues with those, believe it or not. That would explaih how you could get an error and RA didn't.

Link to comment
Share on other sites

I tried compiling MovieBattles' source under VS2005 - it all went good and ok but ingame it apeared that Express is causing some problems - first one I noticed is lag of 3rd person camera (which wasn't there compiling same code with VS2003), second cgame not displaying all messages (kill messages and all the others) from time to time - you killed someone and no message in console nor on your central screen apeared.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...