PDA

View Full Version : Compiling OJP Enhanced in Visual C++ Express


Sushi_CW
07-18-2006, 12:15 AM
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. (http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en)
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.

JRHockney*
07-18-2006, 01:19 AM
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.

Sushi_CW
07-18-2006, 02:54 AM
The solution file to open is "OJP Enhanced.sln". Post a sample of the error messages and I'll take a look. Perhaps my mini-tutorial missed something. :)

JRHockney*
07-18-2006, 12:12 PM
Ok, I opened 'OJP Enhanced.sln.7.10.old' and it doesnt even allow building as an option. Its the only sln in there and its only about 3KB.

Sushi_CW
07-19-2006, 01:24 AM
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?

JRHockney*
07-19-2006, 01:34 AM
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.

JRHockney*
07-19-2006, 07:33 PM
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?

Vruki Salet
07-19-2006, 08:20 PM
Hey Sushi, how is this Express version for efficiency, speediness, resource footprint, etc.? The version I have is a dog and I wonder if it's worth using express instead.

Sushi_CW
07-19-2006, 08:22 PM
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.

Sushi_CW
07-19-2006, 08:33 PM
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 (http://www.codeblocks.org). 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.

JRHockney*
07-19-2006, 08:41 PM
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_vehicle s.h(375) : error C2018: unknown character '0x7f'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ')' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ';' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2061: syntax error : identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2059: syntax error : ')'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(405) : error C2059: syntax error : '}'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2059: syntax error : ';'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C3409: empty attribute block is not allowed
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2143: syntax error : missing ']' before 'constant'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(704) : error C2059: syntax error : '}'
ui_shared.c
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2018: unknown character '0x7f'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ')' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ';' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2061: syntax error : identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2059: syntax error : ')'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(405) : error C2059: syntax error : '}'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2059: syntax error : ';'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C3409: empty attribute block is not allowed
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2143: syntax error : missing ']' before 'constant'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(704) : error C2059: syntax error : '}'
ui_saber.c
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2018: unknown character '0x7f'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ')' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ';' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2061: syntax error : identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2059: syntax error : ')'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(405) : error C2059: syntax error : '}'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2059: syntax error : ';'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C3409: empty attribute block is not allowed
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2143: syntax error : missing ']' before 'constant'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(704) : error C2059: syntax error : '}'
ui_main.c
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2018: unknown character '0x7f'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ')' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2146: syntax error : missing ';' before identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2061: syntax error : identifier 't'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(375) : error C2059: syntax error : ')'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(405) : error C2059: syntax error : '}'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2061: syntax error : identifier 'g_vehicleInfo'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2059: syntax error : ';'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C3409: empty attribute block is not allowed
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(418) : error C2143: syntax error : missing ']' before 'constant'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(651) : error C2061: syntax error : identifier 'vehicleInfo_t'
g:\documents and settings\john\desktop\basic\source\game\bg_vehicle s.h(704) : error C2059: syntax error : '}'
Build log was saved at "file://g:\Documents and Settings\John\Desktop\Basic\source\Debug\ui\BuildL og.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.

Vruki Salet
07-19-2006, 09:35 PM
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?

JRHockney*
07-19-2006, 10:01 PM
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.

Vruki Salet
07-19-2006, 10:49 PM
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.

Vruki Salet
07-19-2006, 11:32 PM
It turns out ASCII 127 (or 0x7F in hex) is a "character" representing DELETE as in your delete key.

Try replacing your copy of bg_vehicles.h with this one:

http://www.taddia.com/vruki/bg_vehicles.h

and see what happens.

JRHockney*
07-19-2006, 11:52 PM
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

Sushi_CW
07-20-2006, 12:06 AM
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.

Vruki Salet
07-20-2006, 12:23 AM
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.

Emiel Regis
07-20-2006, 08:15 AM
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.