Linker error by NXU namespace

Hello, I am using PhysX SDK version 2.8.4, and I am currently trying to save and load a scene.

What do I need to include in order to be able to use the NXU namespace functions?

I added to my projects VC++ Directories → Include Directories the path to NVIDIA Corporation\NVIDIA PhysX SDK\v2.8.4_win\Tools\NxuStream2, but I still get a linker error. Do I need to include something else?

I wrote the following piece of code (which is supposed to save all the actors from the scene to a collection, I know that there is a function which does this, but when I load the collection I don’'t want to treat two cases, one where I saved whole scene and one where I saved only some actors):

#include "NXU_schema.h"
#include "NXU_helper.h"

NXU::NxuPhysicsCollection* collection;


void initSaveScenario(int type)
{
	collection = NXU::createCollection();
	if(type == 0)// save whole scene
	{
		//add all actors from scene to collection
		int nbActors = gScene->getNbActors();
		NxActor** actors = gScene->getActors();
		while (nbActors--)
		{
			NxActor* actor = *actors++;
			NXU::addActor(*collection, *actor, NULL, NULL);
		}
	// Render all the cloths in the scene
	for (MyCloth **cloth = gCloths.begin(); cloth != gCloths.end(); cloth++){
		NxCloth* myCloth = (*cloth)->getNxCloth();
		NXU::addCloth  ( *collection, *myCloth, NULL, NULL); 
	}

}

}

But I get the following errors:

1>IOPBTS.obj : error LNK2001: unresolved external symbol "bool __cdecl NXU::addCloth(class NXU::NxuPhysicsCollection &,class NxCloth &,char const *,char const *)" (?addCloth@NXU@@YA_NAAVNxuPhysicsCollection@1@AAVNxCloth@@PBD2@Z)
1>IOPBTS.obj : error LNK2001: unresolved external symbol "bool __cdecl NXU::addActor(class NXU::NxuPhysicsCollection &,class NxActor &,char const *,char const *)" (?addActor@NXU@@YA_NAAVNxuPhysicsCollection@1@AAVNxActor@@PBD2@Z)
1>IOPBTS.obj : error LNK2001: unresolved external symbol "class NXU::NxuPhysicsCollection * __cdecl NXU::createCollection(char const *,char const *)" (?createCollection@NXU@@YAPAVNxuPhysicsCollection@1@PBD0@Z)

Verify gScene is correct. I think your pointer have not value.

Hi.
Its a linking error - you must link against the neccassary libs. Im not familar with PhysX 2.x - so I cant say anything related to it.

(Thus its not an invalid pointer - because its a linking error - the app didnt run yet to get a null pointer)

You get this error because you didnt link against the needed lib. Search in the lib folder or in the PhysXguide to find the correct lib and link against it.