Jump to content

Home

Compiling the JA:MP SDK


Recommended Posts

Ok, Hi all I have a question about the JA:MP SDK

I have downlaoded Microsoft Visual C++ 2005 Express edition. I managed to open the SDK project files OK however when compiling using the instructions provided with the SDK I got about a Gazillion errors:

 

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(309) : see previous definition of 'sqrtf'

 

c:\documents and settings\owner\desktop\ja sdk\codemp\game\q_shared.h(1242) : error C2059: syntax error : 'type'

..\game\AnimalNPC.c(63) : warning C4005: 'sqrtf' : macro redefinition

 

c:\documents and settings\owner\desktop\ja sdk\codemp\game\q_shared.h(1242) : error C2059: syntax error : 'type'

bg_pmove.c

 

Here is a .ZIP file containing all the Log Files in full.

 

If that link don't work for some reason heres the URL: freewebs.com/domb_152/Log Files.zip

 

And so on. So I was wondering if anyone had instructions on compiling it in Visual C++ 2005 Express OR if anyone could help me do it in Dev C++ that would be most appreciated. Thanks,

 

Dom

 

BTW I used Visual C++ 2005s .sln conversion tool to convert it to a 2005 compatible file.

Link to post
Share on other sites

Whoa. So many errors might mean that you really probably just have a few small problems, that a lot of other things depend on.

 

I'd start from the OJP source, if I were you. The issues you're having compiling have very likely already been solved by razor_ace, ie, the OJP code is cleaner than the stock SDK code (stock meaning 'out of the box', as it were.)

 

OJP Forum

Link to post
Share on other sites

Yep, comment out the line in q_shared.h - you probably already have a powf function in your compiler's headers. I just scrolled through the game compile's logs, but q_shared.h is used in everything anyway.

Link to post
Share on other sites

Here are new log files incase you want/need them.

freewebs.com/dom_152/New Log Files.zip

 

Its all about either functions being declared more than once or declared deprecated. Heres a message it gives in the compile logs " Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'

tri_coll_test.c"

Link to post
Share on other sites

On 1476 in q_math.c there's the powf function. Comment it completely out, according to BuildLog.htm, that's the only error. Alternatively, change the name of the function, to something like 'powf_super_extreme_fighting_edition'.

 

I've only recently adopted such a robust function naming schema, so far it has exceeded my expectations :)

Link to post
Share on other sites

LoL, OK Its gone down to 1 error. Theres something wrong in JK2Game.rc it cannot open the include file "afxres.h". yet JKCGame.rc can...strange. I tried commenting out the line #include "afxres.h" but it jsut causes more errors. SO CLOSE! But so far...

 

EDIT: OK It seems Visual C++ 2005 is missing a lot of include files and library files :-( SO I have copied all the Include files from Dev C++ into Visual 2005 and now its asking for library files.

Link to post
Share on other sites

Righto, I have finally managed to compile the JK2Game DLL. YAY! BUT! I tried to compile JK2CGame and....alas Errors! But tehres nothing wrong the the JK2CGame code at all. All of the errors are from the header files i transferred from Dev C++ to MVCS. Has anyone got Header Files and Library Files that are fully compatible with MVCS?

Link to post
Share on other sites

Ok, Its now giving me errors when I try compiling any of them but the errors are exactly the same it seems that MVCS 2005 is missing a lot of header files and library files. So I tried importing the header files from Dev C++ and I'm getting these errors. I'm gonna try and download the needed .h file and try it then. Build Logs here if you want them. ANd here is the one and only error I'm getting: "C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(4) : fatal error C1083: Cannot open include file: 'sys/cdefs.h': No such file or directory

Generating Code..."

 

EDIT: Found cdefs.h on the net and all the errors are because of my math.h file which is very annoying. Here is an extract from the Build window:

 

------ Build started: Project: botlib, Configuration: Final Win32 ------

Compiling...

l_struct.cpp

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(319) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(319) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(319) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(341) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(341) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(340) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(350) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(350) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(349) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(359) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(359) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(358) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(375) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(375) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(375) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(381) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(381) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(381) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(387) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(387) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(387) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(503) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(503) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(502) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(511) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(511) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(510) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(519) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(519) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(518) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(603) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(603) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(603) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(610) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(610) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(610) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(617) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(617) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(617) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(626) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(626) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(626) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(626) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(634) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(634) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(634) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(634) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(642) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(642) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(642) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(642) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(650) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(650) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(650) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(650) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(658) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(658) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(658) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(658) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(666) : error C2146: syntax error : missing ';' before identifier '__volatile__'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(666) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(666) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(666) : error C3861: '__volatile__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(781) : error C2143: syntax error : missing ')' before ':'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(781) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(780) : error C3861: '__asm__': identifier not found

C:\Program Files\Microsoft Visual Studio 8\VC\include\stddef.h(6) : fatal error C1021: invalid preprocessor command 'include_next

Link to post
Share on other sites

the problem is the version, i had the same errors when trying to compile the code.

 

when i built the source code using the visual c++ 6.0, the code built successfully (i used the universal sdk with the normal sdk header and c source files).

Link to post
Share on other sites
  • 8 months later...
Yep, comment out the line in q_shared.h - you probably already have a powf function in your compiler's headers. I just scrolled through the game compile's logs, but q_shared.h is used in everything anyway.

 

Okay,

 

I have had similar VS 2005 compliation errors, and thought maybe if I posted here, I might be able to narrow this down, and package a version of the source (if allowed) that is compatible with VS 2005.

 

First:

I load up the .sln file, and try to build JK2Game. Why it is JK2Game in the JKA_mp(SDK) is a little perturbing, but I'll go with. I get 89 errors of the

q_shared(1242): float powf( float x, int y ); "type" error. Now, why is this a "type" error. Float and int are normal types, and looking at q_shared.h and q_math.c there should be absolutely no glitch with this function. It is written okay in my book, why wouldn't it compile in the first place?

 

q_shared(1242): 
float powf( float x, int y );

q_math.c(1476-1482):
float powf( float x, int y )
{
float r = x;
for ( y--; y>0; y-- )
	r = r * r;
return r;
}

But nevertheless, I commented it out, like suggested.

then I get warnings, now warnings aren't so bad, because it actually compiles, but it's about a macro redefinition: math.h is the original, and for some reason the added .c files redefine sqrtf as something else. I tried removing those #define statements from the .c files and that didn't work.

 

mvs8/vs/include/math.h(309): #define sqrtf(x) ((float)sqrt((double)(x)))

AnimalNPC.c (63): #define sqrtf sqrt

FighterNPC.c (63): #define sqrtf sqrt

SpeederNPC.c (63): #define sqrtf sqrt

WalkerNPC.c (63): #define sqrtf sqrt

gvehicles.c(34): #define sqrtf sqrt

 

When i compile Jk2cgame i get the same sqrtf warnings, but also warnings concerning stricmp versus _stricmp. Should I repair this, or is okay to leave these warnings as they are?

 

Thanks

Jaeden "Sifo Dyas' al'Raec Ruiner

Link to post
Share on other sites
  • 1 month later...

Found something that helps!

Open the JK2Game.rc, JK2cgame.rc and ui.rc found wherever you put your SDK code, in my case: C:\projects\JEDI_Academy_SDK\Loony\win32

 

You can open them with Notepad.

 

Find the TWO instances of AFXRES.H in each file and replace them with WINRESRC.H

 

I'm still getting 184 warnings, but it looks like most are coming from the same problem. Assuming I can work out how to fix it, would it be helpful to people for me to re-distribute the FIXED version of the SDK so that it should in theory compile perfectly right out of the box in Visual C++ 2005 Express?

 

I could also whip up a quick "how to" for getting VC++2005E set up to work with JKA.

 

Let me know

Loony

Link to post
Share on other sites
×
×
  • Create New...