tutorial error

jarwulf

11-06-2010 05:37:10

I'm trying to build beta's NXogre tutorial 1 but I get this linker error


1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>bin\Debug\PhysicsFirst.exe : fatal error LNK1120: 1 unresolved externals

I've linked to the files for Ogre, NxOgre, and critter. Is there anything else needed?

betajaen

11-06-2010 10:30:03

You probably forgot to put the main function in.

Which tutorial is this?

jarwulf

11-06-2010 18:52:28

You probably forgot to put the main function in.

Which tutorial is this?



This is the very first tutorial I think...I assumed main would be in one of the included files but do you have to manually put it in? Could I just cut and paste the main from one of the ogre framework? If not what would I use?

betajaen

11-06-2010 19:39:40

No, I mean which set of tutorials - Spacegaiers (the ones on the wiki) or mine (the ones at github)?

If it's mine, then you don't need a main function. There is a visual studio project which you just compile and it's good to go.
If it's spacegaiers, then you do need a main function, but all the code is there.

jarwulf

11-06-2010 21:17:01

Yeah its the first one of your new tutorials.

Oops so its just building some library files? I assumed I'd be able to get an exe out of the box. Right now I'm sort of confused as to how to use what it builds. What do I use with the lib files and dll I get?

betajaen

12-06-2010 13:34:52

In Ogre 1.7.0 there is a new SampleBrowser to display all the wonderful samples and demos Ogre can do, all the samples are loaded in as plugins. It comes with a bunch of wonderful Ogre framework code which anyone can use.

I've used this Ogre framework, to create the tutorials as plugins which the SampleBrowser you can use. It merely uses the framework to hide all the Ogre things that are common and get in the way, so you can see all the important NxOgre and Ogre stuff only.

When you compile any tutorial it compiles it as a plugin and copies itself into the Sample directory. Just copy the media (as per the instructions) and run the SampleBrowser (again in the instructions) and your good to go.

jarwulf

13-06-2010 07:12:54

Alright I got it working in a framework I'd been using. a couple questions though

Do you have to attach an entity to the Body in order to apply a material to it?

How do you make the block solid?

Also is the block supposed to be on a solid plane? Because it sort of behaves like its in space spinning around a lot when force is applied? But it always settles back down on the plane once its finished spinning.

betajaen

13-06-2010 11:50:27

An Ogre material? Yes of course.

If it has a shape (and the Actor won't be created if it doesn't), then it is solid.

You have gravity on? And the default NxOgre material set to something sensible?

jarwulf

14-06-2010 02:41:20

I followed the instructions on the Gitpage but the browser refuses to recognize the tutorial samples. the building of the samples goes successfully except that it says NXogre.dll isn't found but other than that everything goes well. If i try to run the sample browser they don't appear it says the dlls are corrupt or not found. If I copy over NXogre.dll it crashes after loading "font.def"

jarwulf

14-06-2010 03:05:05

Here is a video of the object behavior in question (apologies for the quality but its good enough to see what's going on.

http://www.youtube.com/watch?v=vYOX6-c9Q4M


The boxes go through each other at the very beginning and move oddly. The physics is lifted entirely from tutorial 101. Additional Body is autoattached to a scenenode right? If I attached a similar shaped entity to the scenenode would it move along with the Body?


PHYSICS
// Create the world.
mWorld = NxOgre::World::createWorld();

mWorld->getRemoteDebugger()->connect();

// Create the scene
NxOgre::SceneDescription scene_description;
scene_description.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
scene_description.mUseHardware = false;

mScene = mWorld->createScene(scene_description);

// Set default material properties
mDefaultMaterial = mScene->getMaterial(0);
mDefaultMaterial->setRestitution(0.1f);
mDefaultMaterial->setDynamicFriction(0.9);
mDefaultMaterial->setStaticFriction(0.5);

// Plane creation
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());

// Create the rendersystem.
mRenderSystem = new Critter::RenderSystem(mScene, mSceneMgr);

// mRenderSystem->setVisualisationMode(NxOgre::Enums::VisualDebugger_ShowAll);
// Setup a BodyDescription.
Critter::BodyDescription bodyDescription, bodyDescription2;
bodyDescription.mMass = 40.0f; // Set the mass to 40kg.
bodyDescription2.mMass = 40.0f;
// Finally create the body.


mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,100,0), "cube.mesh", bodyDescription);
mBody2 = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,0,0), "cube.mesh", bodyDescription2);
mBody2->setGlobalPosition(100,0,0);


Floor code

Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0);
Ogre::MeshManager::getSingleton().createPlane("ground",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
1500,1500,20,20,true,1,5,5,Ogre::Vector3::UNIT_Z);

Ogre::Entity *ent;
ent = mSceneMgr->createEntity("GroundEntity", "ground");
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);



Force applied by keys
NxOgre::Vec3 force;

//Addition
if (arg.key == OIS::KC_I)
force.z += 1;
else if (arg.key == OIS::KC_K)
force.z -= 1;
else if (arg.key == OIS::KC_J)
force.x -= 1;
else if (arg.key == OIS::KC_L)
force.x += 1;
else if (arg.key == OIS::KC_U)
force.y += 1;
else if (arg.key == OIS::KC_M)
force.y -= 1;

if (!force.isZero())
mBody->addForce(MaxStrength * force * mLastTimeStep);

if (arg.key == OIS::KC_T)
mBody->setGlobalPosition(NxOgre::Vec3(0,1,0));





mCameraMan->injectKeyDown(arg);
return true;

aay9203

21-07-2010 04:14:45

Hi there,

First Betajaen thanks for the hard work you put in to bring Detritus and Critter to life. I appreciate this.

For the last two days I have been trying to install Detritus and Critter along with the turorials. I have as advised first downloaded NxOgre Detritus then Critter built Detritus first followed by Critter. I have turned the charactercontroller on in the NxConfig file. Subsequently I downloaded the tutorials and built them too. The dll files have been copied to the sdk directory of Ogre home. However, when I try to run the SampleBrowser I get the error "The Application has failed to start because NxCharacter.dll was not found". I tried copying the Physics NxCharacter.dll over to the sdk folder but it does not work.

At a loss.

Can anyone help me in this regards,

Thanks in advance

P.S. I have compiled Ogre 1.7 with Visual studio 8 and then used visual studio 9 with NxOgre, critter and the tutorials could this be a source of the problem?

betajaen

21-07-2010 09:33:10

NxCharacter.dll needs to be copied to your application folder.