linking difficulties

njguy

05-08-2008 02:52:46

I am having difficulties linking nxogre to my compiler. I use VC2005.

I put this under the include section in VC++ Directories..
$(PHYSX_DIR)C:/OgreSDK\dev\NXOgre

Is that correct??

I installed the Physx SDK under /dev which is the root folder of NXOgre as well, which is in my Ogre SDK. I have yet to link th physx directories in the compiler. Not sure what to link there either.

I cannot seem to find a really comprehensive installation guide.

s0lidnuts

05-08-2008 03:00:07

Nah
You have to get $(PHYSX_DIR) value and work with it.
if $(PHYSX_DIR) = C:/OgreSDK/dev then VC++ = $(PHYSX_DIR)\NxOgre
In this link you'll find on how to set up VC++ directories

http://ogre.irados.org/textos/bibliotecas/NxParte2.htm
It is written in Portuguese but you should be able to find the info you need.

njguy

05-08-2008 03:03:54

Nah
You have to get $(PHYSX_DIR) value and work with it.
if $(PHYSX_DIR) = C:/OgreSDK/dev then VC++ = $(PHYSX_DIR)\NxOgre


I put that where I had it originally?? Not sure what your saying.

njguy

05-08-2008 03:23:06

$(PHYSX_DIR), is just the variable that holds the path of the directory containing the physx sdk right?? nxogre then takes that variable and automatically links it right?? So isnt that the only variable i have to declare to make nxogre work with physx??

s0lidnuts

05-08-2008 03:29:45

Are you talking about compiling NxOgre? If yes then:
NxOgre relies on PHYSX_DIR (PhysX SDK Directory, D:\c0de\SDK\PhysX 2.8.1 for me) and OGRE_HOME (path to OGRE's OgreMain directory).

Hope that helps.
Cya

njguy

05-08-2008 03:53:17

that helped, I got NxOgre.VC8.Windows compiled. Although I am not sure what that even did. What exactly am I supposed to compile and for what purpose??

reptor

05-08-2008 17:58:37

You should get:

NxOgre.lib
NxOgre_d.lib
NxOgreS.lib
NxOgreStatic.lib
NxOgreStatic_d.lib

and

NxOgre.dll
NxOgre_d.dll
NxOgreS.dll

And then you have the NxOgre library header files (inside the "include" directory in the NxOgre directory).

When you want to use NxOgre in your application, you:

1) tell your compiler where it can find the NxOgre header files (in addition to the PhysX header files)

2) tell your linker that you want it to link one of the .lib files with your application (the ones with _d are for Debug, the ones without it are for Release). You also need to link PhysX.

You can ignore the NxOgreStatic.lib and NxOgreStatic_d.lib if you don't want to statically link NxOgre with your application (NxOgre code would be put to the same file with your application code) if you do that then that would complicate the licensing, so just ignore it and use the other ones and use the dlls. If you link statically, you wouldn't need to use the NxOgre.dll.

The "NxOgreS" is a "Small" version, you can just ignore it and maybe search the forum for info on what it exactly has less than the "normal" NxOgre version. You can safely ignore it completely for now.

3) you include perhaps "NxOgre.h" into your source code file

4) then write code which uses NxOgre in that file...

5) then compile your application

6) make sure you have the corresponding .dll file in the application's executable directory (if Debug, then NxOgre_d.dll, if Release then NxOgre.dll). also make sure there are the required PhysX dlls: I have PhysXLoader.dll, NxCooking.dll and NxCharacter.dll in the app. dir but all are not necessarily always required. just put them there now to get it working. you can find them from somewhere from the PhysX SDK directory.

7) run the application from the executable directory



hopefully I didn't miss a step.


This is part of "how to use compiler and linker basics".

betajaen

05-08-2008 19:12:18

I think Reptor covers it. If your unsure what PhysX libraries and/or include directories to use, these are:

Headers
$(PHYSX_DIR)\SDKs\Physics\include
$(PHYSX_DIR)\SDKs\Foundation\include
$(PHYSX_DIR)\SDKs\Cooking\include
$(PHYSX_DIR)\SDKs\PhysXLoader\include


PhysX .lib directories
$(PHYSX_DIR)\SDKs\lib\win32
$(PHYSX_DIR)\SDKs\Physics\lib\win32\Release
$(PHYSX_DIR)\SDKs\Cooking\lib\win32\Release


PhysX .libs to use
PhysXLoader.lib
NxCooking.lib

njguy

05-08-2008 21:36:21

You should get:

NxOgre.lib
NxOgre_d.lib
NxOgreS.lib
NxOgreStatic.lib
NxOgreStatic_d.lib

and

NxOgre.dll
NxOgre_d.dll
NxOgreS.dll


I didnt get any of those, when i first compiled it, it did so with no errors but a few warnings. Now when I compile, it just says up to date. What exactly am I supposed to compile??

betajaen

05-08-2008 21:47:13

If it compiles with no errors, then you should find them in the NxOgre/lib folder

njguy

05-08-2008 22:16:10

If it compiles with no errors, then you should find them in the NxOgre/lib folder

Nope only things in NXOGRE/lib is .svn folder and NxOgreStatic_d
Sorry about the long output window :?

Output Window
Compiling...
NxOgreStable.cpp
Compiling...
BetajaenCC.cpp
NxOgreWorld.cpp
NxOgreWheelSet.cpp
NxOgreUserAllocator.cpp
NxOgreTriggerCallback.cpp
NxOgreTrigger.cpp
NxOgreTimer.cpp
NxOgreTimeController.cpp
NxOgreThrow.cpp
NxOgreTesting.cpp
NxOgreSoftBody.cpp
NxOgreSleepCallback.cpp
NxOgreSimpleShape.cpp
NxOgreSimpleActor.cpp
NxOgreSheet.cpp
NxOgreShapeWheel.cpp
NxOgreShapeTerrain.cpp
NxOgreShapePrimitives.cpp
NxOgreShapeMeshes.cpp
NxOgreShape.cpp
Generating Code...
Compiling...
NxOgreSceneTriggerController.cpp
NxOgreSceneSource.cpp
NxOgreSceneRenderer.cpp
NxOgreSceneController.cpp
NxOgreSceneContactController.cpp
NxOgreScene.cpp
NxOgreResourceSystem.cpp
NxOgreResourceManager.cpp
NxOgreResourceCallback.cpp
NxOgreResource.cpp
NxOgreRenderableSource.cpp
NxOgreRenderable.cpp
NxOgreRemoteDebuggerConnection.cpp
NxOgreRaycaster.cpp
NxOgrePose.cpp
NxOgrePhysXDriver.cpp
NxOgrePerformer.cpp
NxOgreParams.cpp
NxOgreOgreTimeController.cpp
NxOgreOgreSceneRenderer.cpp
Generating Code...
Compiling...
NxOgreOgreNodeRenderable.cpp
NxOgreOgreMeshRenderable.cpp
NxOgreNxActorController.cpp
NxOgreNodeRenderable.cpp
NxOgreMeshRenderable.cpp
NxOgreMeshParams.cpp
NxOgreMesh.cpp
NxOgreMemoryResourceManager.cpp
NxOgreMemoryResource.cpp
NxOgreMaterial.cpp
NxOgreManualMeshUtil.cpp
NxOgreManualMesh.cpp
NxOgreManualHeightfield.cpp
NxOgreMachine.cpp
NxOgreLog.cpp
NxOgreKinematicCharacter.cpp
NxOgreJointSet2.cpp
NxOgreJointSet1.cpp
NxOgreJointCallback.cpp
NxOgreJoint.cpp
Generating Code...
Compiling...
NxOgreIntersection.cpp
NxOgreHelpers.cpp
NxOgreHeightfield.cpp
NxOgreGroup.cpp
NxOgreForceField.cpp
NxOgreFileResourceManager.cpp
NxOgreFileResource.cpp
NxOgreExtendedTypes.cpp
NxOgreError.cpp
NxOgreEngine.cpp
NxOgreEffectsSystem.cpp
NxOgreDualIdentifier.cpp
NxOgreDominanceGroup.cpp
NxOgreDeletionCallback.cpp
NxOgreDebugRenderer.cpp
NxOgreContainer.cpp
NxOgreContactStream.cpp
NxOgreContactCallbackController.cpp
NxOgreContactCallback.cpp
NxOgreCompoundActor.cpp
Generating Code...
Compiling...
NxOgreClothRaycaster.cpp
NxOgreCloth.cpp
NxOgreCharacterMovementModel.cpp
NxOgreCharacterModel.cpp
NxOgreCharacterController.cpp
NxOgreCharacter.cpp
NxOgreBody.cpp
NxOgreAllocator.cpp
NxOgreActor.cpp
Generating Code...
Creating library...
NxOgreUserAllocator.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreTriggerCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreTimeController.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreTesting.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreSoftBody.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreSleepCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreResourceManager.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgrePose.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreManualMeshUtil.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreJointCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreForceField.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreExtendedTypes.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreEffectsSystem.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreDeletionCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreContainer.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreCompoundActor.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreClothRaycaster.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreCloth.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreCharacterMovementModel.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
NxOgreCharacterModel.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
Performing Post-Build Event...
1 file(s) copied.

Results
Build log was saved at "file://C:\OgreSDK\dev\NXOgre\compiler\Windows\DebugStatic\BuildLog.htm"
NxOgre - 0 error(s), 20 warning(s)

betajaen

05-08-2008 23:03:47

Your compiling the project as DebugStatic, I'm sure you know how to build the solution properly or select a different compile mode.

njguy

06-08-2008 00:12:26

thanks I changed to release, didn't even see that. Thanks that worked.

njguy

06-08-2008 22:10:52

I'm sorry I am really bad at setting up compilers. To have my compiler know where header files are, i just put the location under tools, options, VC++ Directories, include??

Do I do the same thing for library files?? Instead of include, put it under library?? How do I specify which library.

2) tell your linker that you want it to link one of the .lib files with your application (the ones with _d are for Debug, the ones without it are for Release). You also need to link PhysX.

Dont know what the linker is..don't see anything for linker. It could just be me being stupid. I'm bad at the installation, I basically just need to get on my feet.