compiling ackphysx.dll under VS2005

Posted By: HeelX

compiling ackphysx.dll under VS2005 - 10/05/11 16:06

Hi, I found out in the NVidia SDK that there are more joints available than the Gamestudio ones.. and since I need those, I want to implement them myself into the ackphysx.dll. Since I use VS 2005, I just wanted to make a thread about it, because I already face some problems...

Problem: when including NxWheel.h....NxMath.h, I get everytime an error, because the standard min and max macros are defined. You can say with #define NOMINMAX before #include <windows.h>, that you don't want them, but the error is still thrown during compilation! I can write #undef min and #undef max after including windows.h so that I get no error and it compiles, but I think that isn't the way it should be, right?

Code:
#include "stdafx.h"

#ifdef _MANAGED
#pragma managed(push, off)
#endif

#define NOMINMAX
#include <windows.h>
//#undef min
//#undef max // compiles, but is this right???

// engine
#define DLL_USE
#include "adll.h"

// physx..
#include "NxWheel.h" // in NxMath.h: Error: min or max is #defined

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    // link acknex engine
    engine_bind();

    return TRUE;
}

DLLFUNC void ackphysx_dll (void)
{
    error("say hello to ackphysx.dll!");
}

#ifdef _MANAGED
#pragma managed(pop)
#endif



Has anyone tried that???
Posted By: HeelX

Re: compiling ackphysx.dll under VS2005 - 10/05/11 16:55

Ok, solution is to add #define NOMINMAX in the stdafx.h before including windows.h... frown stupid me.
Posted By: HeelX

Re: compiling ackphysx.dll under VS2005 - 10/05/11 19:52

Here are some info for others which don't have VS 2010 and want to compile it against VS 2005:

- simply add all include folders of the PhysX SDK folder to your directory settings
- the PhysX plugin source uses a lot of code from the PhysX sample folders, so it is also necessary to add the SampleCommonCode folder
- add the sample folders SampleRaycastCar, SampleCharacterController, and maybe I forgot some
- make sure you link against all PhysX libs... I had lots of problems and after I added all, they were gone
- add as source files in the project tab only main.cpp, CharacterControl.cpp, external.cpp and PhysX.cpp
- if you use a precompiled header, open it (stdafx.h) and write #define NOMINMAX before #include <windows.h>
- if you have trouble with ErrorStream.h with the call of MessageBox and casting a string to LPCWSTR, just uncomment the whole switch and return NX_AR_BREAKPOINT. If you can't overwrite the file, make a copy and copy it into your project folder
- if you problems with the plugin headers, try #pragma once instead of the #define guard... I don't know if that solved one of my problems but I better repeat it hear smile
- to test your own dll, make sure that the ORIGINAL ackphysx.dll in acknex_plugins is renamed so that it is NOT loaded, like ackphysx.jcl or so... wink
- if you add features (like me, adding prismatic joints, see here), make sure that you make a copy of the ackphysX.h, copy it in your project folder and do an include with "..." instead of <...>

I hope it helps!

Btw, the source is so horrible.
Posted By: TechMuc

Re: compiling ackphysx.dll under VS2005 - 10/09/11 15:16

Quote:
Btw, the source is so horrible.


Actually it reminded me on the GED source code - which is horrible too - both are just the source code of a programmer making his first really big (not first at all) project - which was planned to be smaller, but got bigger laugh
Honestly i do not know why jcl buys this stuff and doesn't let a real professional do such work..but nevermind.
Posted By: HeelX

Re: compiling ackphysx.dll under VS2005 - 10/09/11 15:25

If OpGroup/JCL (OJ) is rewriting WED, which is/should be essentially a blend between WED and GED, it could be nice if OJ just releases the source of GED so that other could maybe benefit from it. Or are the rights at Crew51? Afaik, André & Co. don't make games anymore (Call of Death, RIP), so, it could be a nice thing to open it, even if it is "horrible".
© 2024 lite-C Forums