Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Compiling the JA:MP SDK

Page: 1 of 1
 Dom_152
01-02-2006, 9:37 AM
#1
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 (http://www.freewebs.com/domb_152/Log%20Files.zip) 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.
 Wudan
01-02-2006, 12:01 PM
#2
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 (http://www.lucasforums.com/forumdisplay.php?s=&forumid=542)
 Dom_152
01-02-2006, 12:44 PM
#3
LoL I have no idea how to get the OJP code. But I know that it is a small error as all the errors have something to do with "type"...
 Wudan
01-02-2006, 3:40 PM
#4
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.
 Dom_152
01-02-2006, 4:54 PM
#5
OK I commented out the line "float powf ( float x, int y );" but now I seem to be getting brand new errors and its still not building the DLLs
 Dom_152
01-02-2006, 5:03 PM
#6
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"
 Wudan
01-03-2006, 12:42 PM
#7
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 :)
 Dom_152
01-03-2006, 1:29 PM
#8
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.
 Dom_152
01-03-2006, 2:15 PM
#9
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?
 ensiform
01-03-2006, 7:58 PM
#10
yes the powf function was in cgame anyway so kinda weird why that doesnt compile.
 Wudan
01-04-2006, 8:28 AM
#11
That is odd behavior - got an error log of what's going on when you compile cgame?

Making server side mods is pretty cool though :P
 Dom_152
01-04-2006, 11:28 AM
#12
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
 AlphaleX
01-04-2006, 2:03 PM
#13
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).
 Dom_152
01-04-2006, 3:45 PM
#14
But I do not have access to other versions. This is my only way. Unless someone works out how to compile with Dev C++
 AlphaleX
01-04-2006, 8:20 PM
#15
ah yes, i downloaded visual c++ from bittorrent, but i forgot the link :(

and i tried to compile it with dev c++ but i couldn't obtain it
 Dom_152
01-05-2006, 1:22 PM
#16
Boo Ya, I got it to compile with Visual Studio 6 and a handy .sln to a VS6 Project file converter.
 Wudan
01-05-2006, 1:34 PM
#17
congrats :) You've taken your first step in to a larger world.
 Dom_152
01-05-2006, 3:25 PM
#18
:lightning You know I could feel something. I could almost see the remote!

EDIT: Are you the creator of ForceMod III? If so I love it. Great work!
 Wudan
01-05-2006, 5:30 PM
#19
Nope, that's not me, that's my good buddy Azymn. Here's proof we're 2 different people:
Wudan (left) & Azymn (right) (http://mt-wudan.com/img/wudan_azymn.jpg).

I do host his site at mt-wudan.com and of course, his forums are there also.
 Dom_152
01-06-2006, 2:13 AM
#20
Proof! \o/ Yeah well tell him I love it! He's done a great job on it :D
 Tinny
01-06-2006, 2:34 AM
#21
Haha, now I know what Azymn and you look like.
 Dom_152
01-06-2006, 10:43 AM
#22
Oh dear...watch out Wudan
 dumbledore
01-08-2006, 9:25 PM
#23
btw compiling in dev-c++ is easy how could you not obtain it =/

http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe) for the installer ;)

and to compile iirc you can import the vc6 project files or convert them by hand ;)
 JaedenRuiner
09-18-2006, 7:03 PM
#24
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
 Loony
10-25-2006, 7:42 PM
#25
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
 Tinny
10-26-2006, 2:50 PM
#26
Check out the new ojp source codes. Razor made header files that makes the compiler ignore a ton of warnings. Btw, does anyone now how to work the edit and continue feature they have in vs2k5?
 ensiform
10-26-2006, 4:07 PM
#27
Edit and continue u r?

Isn't that just so that you can continue editing while it is building but doesn't actually affect the code that is being built? VS2003 has that.
 razorace
10-26-2006, 4:52 PM
#28
It's pretty simple. Just use the Debug->Apply Code Changes command to apply any modifications you make. I should note however that JKA only "remembers" the changes until the map loads. To truely apply your dynamic code changes, you have to stop your game and rebuild.
 FuL*CruM
12-24-2007, 4:01 PM
#29
sorry to bring back a dead thread, but what line is the q_shared float powf line in?
 Xandy
12-24-2007, 5:07 PM
#30
somewhere around 1293 (basic ojp code anyway)
 Tinny
12-24-2007, 9:09 PM
#31
You can do a search for float powf also with ctrl + shift + f and have it search the entire solution.
Page: 1 of 1