Problem with VC9 and NxOgre 1.0

PeTkO

07-09-2008 17:07:05

Hi,

I have a big problem.In my project I add new include directories, library directories and library dependencies.But, when I build project (release) I have one error: fatal error C1083: Cannot open include file: 'OgreNoMemoryMacros.h': No such file or directory!

How can I fix that problem?

P.S.

The source code is simple_sample!

And, sry for my bad english

betajaen

07-09-2008 17:50:17

You can delete the offending lines.

PeTkO

07-09-2008 17:56:57

What "offending lines"?I don't understand you

Prophet

07-09-2008 17:59:33

The #include "OgreNoMemoryMacros.h".

Jallen

07-09-2008 18:33:39

That's odd. I wonder what the cause is. I had no such trouble when compiling NxOgre, or any apps using it.

PeTkO

07-09-2008 18:36:23

hmm...I don't have that line in code.But, i found on internet code for "OgreNoMemoryMacros.h" and "OgreMemoryMacros.h", but when I build project I get error:"cannot open input file 'NxOgre.lib'".Where I can found that library?

Prophet

07-09-2008 18:41:40

If I don't remember incorrectly (which I do quite often, so...) it's due to Shoggoth (Ogre 1.6.0).
You may not have it in code, but I believe NxOgre has it. Search through the entire project.

KevinMulder

07-09-2008 19:04:03

hmm...I don't have that line in code.But, i found on internet code for "OgreNoMemoryMacros.h" and "OgreMemoryMacros.h", but when I build project I get error:"cannot open input file 'NxOgre.lib'".Where I can found that library?

Search through the NxOgre directory (usually in the \lib subdirectory). You should find it there. If that is not existent it means that the compilation was not successful. So ...

Solutions:
problem #1:

#include <OgreMemoryMacros.h> should be:
//#include <OgreMemoryMacros.h> // commented out, it is not used anymore

problem #2:
Compile NxOgre for both release and debug. If You previously compiled it only for debug, you can find nxogre_d.lib in .\lib but not nxogre.lib. For nxogre.lib the release version of nxogre lib should be compiled.

PeTkO

07-09-2008 19:08:28

Hm, maybe I'am stupid, but how to compile NxOgre?I'am beginner in NxOgre

KevinMulder

07-09-2008 19:13:59

OFF:

I would nicely advice You to learn C++ and usage of your IDE before starting to use advanced engines like Ogre, Physx and NxOgre. Running into the concrete wall with full steam cause a hard headache. Knowing your tools is the base of programming.

ON:

First of all please specify what tools You use: (operating system, NxOgre version, Ogre version, Physx version, hardware, IDE and other things You think having valuable information.

PeTkO

07-09-2008 20:21:54

@KevinMulder

I programming already almost 2 years in C++, but I never use engines for game development.I only use Torque2d, but he have own script.

I work on Windows XP SP2 with: Ogre 1.6.0, NxOgre 1.0, PhysX 2.8.0, Microsoft Visual C++ 2008, very powerful hardware...

I found on internet some NxOgre.lib file.And when I insert into my project folder, and build project, I get 19 errors:


1>------ Build started: Project: Test2, Configuration: Release Win32 ------
1>Linking...
1> Creating library D:\Ogre Test\Test2\Release\Test2.lib and object D:\Ogre Test\Test2\Release\Test2.exp
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: __thiscall NxOgre::Cube::Cube(float,class NxOgre::ShapeParams const &)" (??0Cube@NxOgre@@QAE@MABVShapeParams@1@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: class NxOgre::Body * __thiscall NxOgre::Scene::createBody(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class NxOgre::Shape *,class NxOgre::Pose const &,class NxOgre::NodeRenderableParams const &,class NxOgre::ActorParams const &)" (?createBody@Scene@NxOgre@@QAEPAVBody@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVShape@2@ABVPose@2@ABVNodeRenderableParams@2@ABVActorParams@2@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: void __thiscall NxOgre::Allocator::watch_delete(void *)" (?watch_delete@Allocator@NxOgre@@QAEXPAX@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: static class NxOgre::Allocator * __cdecl NxOgre::Allocator::getPtr(void)" (?getPtr@Allocator@NxOgre@@SAPAV12@XZ)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: __thiscall NxOgre::World::World(class NxOgre::PhysXParams,bool)" (??0World@NxOgre@@QAE@VPhysXParams@1@_N@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::ShapeParams::parse(class Betajaen::SharedList<class Betajaen::Vector2<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class Betajaen::SharedAllocator>)" (?parse@ShapeParams@NxOgre@@UAEXV?$SharedList@V?$Vector2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Betajaen@@VSharedAllocator@2@@Betajaen@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall NxOgre::ActorParams::parse(class Betajaen::SharedList<class Betajaen::Vector2<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class Betajaen::SharedAllocator>)" (?parse@ActorParams@NxOgre@@EAEXV?$SharedList@V?$Vector2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Betajaen@@VSharedAllocator@2@@Betajaen@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::SceneParams::SceneFlags::parse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse@SceneFlags@SceneParams@NxOgre@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall NxOgre::SceneParams::SceneFlags::toNxU32(void)const " (?toNxU32@SceneFlags@SceneParams@NxOgre@@UBEIXZ)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::SceneParams::SceneFlags::fromNxU32(unsigned int)" (?fromNxU32@SceneFlags@SceneParams@NxOgre@@UAEXI@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall NxOgre::SceneParams::parse(class Betajaen::SharedList<class Betajaen::Vector2<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class Betajaen::SharedAllocator>)" (?parse@SceneParams@NxOgre@@MAEXV?$SharedList@V?$Vector2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Betajaen@@VSharedAllocator@2@@Betajaen@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::PhysXParams::PhysXSDKFlags::parse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse@PhysXSDKFlags@PhysXParams@NxOgre@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall NxOgre::PhysXParams::PhysXSDKFlags::toNxU32(void)const " (?toNxU32@PhysXSDKFlags@PhysXParams@NxOgre@@UBEIXZ)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::PhysXParams::PhysXSDKFlags::fromNxU32(unsigned int)" (?fromNxU32@PhysXSDKFlags@PhysXParams@NxOgre@@UAEXI@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall NxOgre::PhysXParams::parse(class Betajaen::SharedList<class Betajaen::Vector2<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class Betajaen::SharedAllocator>)" (?parse@PhysXParams@NxOgre@@MAEXV?$SharedList@V?$Vector2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Betajaen@@VSharedAllocator@2@@Betajaen@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::PhysXParams::setToDefault(void)" (?setToDefault@PhysXParams@NxOgre@@UAEXXZ)
1>simple_sample.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall NxOgre::NodeRenderableParams::parse(class Betajaen::SharedList<class Betajaen::Vector2<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class Betajaen::SharedAllocator>)" (?parse@NodeRenderableParams@NxOgre@@MAEXV?$SharedList@V?$Vector2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Betajaen@@VSharedAllocator@2@@Betajaen@@@Z)
1>simple_sample.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NxOgre::NodeRenderableParams::setToDefault(void)" (?setToDefault@NodeRenderableParams@NxOgre@@UAEXXZ)
1>D:\Ogre Test\Test2\Release\Test2.exe : fatal error LNK1120: 18 unresolved externals
1>Build log was saved at "file://d:\Ogre Test\Test2\Test2\Release\BuildLog.htm"
1>Test2 - 19 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


P.S.

I should be grateful if you would help me :)

Cheers

KevinMulder

07-09-2008 20:33:33

Ok.

Open the nxogre solution file, then select Debug in the Solution Configurations (it is a combobox, in the middle, top of the screen, next to the Win32 combobox ) Then select the NxOgre project in the Solution explorer. Right click, then Select build.

Then change to Release From Debug in Solution Configuration. Build again.

If everything compiles fine you should find nxogre.lib and nxogre_d.lib in .\lib in nxogre installation directory.

Downloading .dll and copying them around in your system is dangerous. You should ALWAYS use the dll compiled prevoiusly by yourself. In that case it matches everything it references.

If your dlls and header files mismatch then you got this kind of problem, since the dll does not contain the entry point what the header file references to.

So, go ahead, wipe out all downloaded dlls and compile ogre and nxogre first, before doing anything else.

PeTkO

07-09-2008 21:29:22

I compile NxOGRE!!!Bravo for me :D

But, when I compile simple_sample project, and when I run, I have only black screen and I hear error sound, but I can't read that error because the black screen is across message.Do you have any else example for NxOgre?

Here you code:

simple_sample.cpp:
/* NxOgre Tutorial 1: Simple Sample by radsun */

#include "simple_sample.h"

// startup
INT WINAPI WinMain(HINSTANCE , HINSTANCE, LPSTR, INT)
{
SimpleSampleApplication app;

// aplication setup and loop
try {
app.go();
} catch( Ogre::Exception& e ) {
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
}

return 0;
}


and simple_sample.h


// NxOgre tutorials is using ogre example application framework
#include "ExampleApplication.h"

// only file you need to include to use NxOgre
#include "NxOgre.h"

// NxOgre have his own namespace, remember to use it
using namespace NxOgre;

// frame listener
class SimpleSampleFrameListener : public ExampleFrameListener
{
public:
SimpleSampleFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam )
{
}

bool frameStarted( const FrameEvent& evt )
{
if( ExampleFrameListener::frameStarted(evt) == false )
return false;

return true;
}
};

// application
class SimpleSampleApplication : public ExampleApplication
{
public:
SimpleSampleApplication()
{
createdObjects = 0;
}

protected:
virtual void createFrameListener(void)
{
mFrameListener= new SimpleSampleFrameListener(mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}

// create box on with given position and scale
void createBox(Vector3 pos,float scale = 1)
{
// this is a scale between Ogre and NxOgre
// for example if u set scale to 5 it will be 0.1 in Ogre and 10 in NxOgre
static const Real mesh_scale = 0.02;
static const Real physics_scale = 2.0;
// create a name for object
String name = "Box_" + StringConverter::toString(createdObjects);
// incrase number of objects
createdObjects++;

// [OGRE] create box, set material and scale it
Ogre::Entity *E = mSceneMgr->createEntity( name+"_entity", "cube.mesh" );
E->setMaterialName("Examples/10PointBlock");
Ogre::SceneNode *sn = mSceneMgr->getRootSceneNode()->createChildSceneNode( name+"_node" );
sn->attachObject( E );
sn->scale( Vector3::UNIT_SCALE * mesh_scale * scale );

// create node renderable parms for body
NodeRenderableParams nrp;
nrp.setToDefault();
nrp.mIdentifierUsage = NxOgre::NodeRenderableParams::IU_Use;
nrp.mIdentifier = sn->getName();

// create body (name,shape,position,node rednderable params,actor params)
// actor params is for example mass
NxOgre::Body *body = mNxScene->createBody(name+"_body",new Cube(scale*physics_scale),pos,nrp,"mass:10");
}

void createScene(void)
{
// [OGRE] set up camera
mCamera->setPosition(Vector3(0,10,20));
mCamera->lookAt(Vector3(0,0,0));
mCamera->setNearClipDistance(1);

// [OGRE] build floor
int i = 0;
StaticGeometry* s;
s = mSceneMgr->createStaticGeometry("StaticFloor");
s->setRegionDimensions(Vector3(160.0, 100.0, 160.0));
s->setOrigin(Vector3::ZERO);
for (Real z = -80.0;z <= 80.0;z += 20.0)
{
for (Real x = -80.0;x <= 80.0;x += 20.0)
{
String name = String("Plane_") + StringConverter::toString(i++);

Entity* entity = mSceneMgr->createEntity(name, "plane.mesh");
entity->setQueryFlags (0);
entity->setCastShadows(false);
s->addEntity(entity, Vector3(x,0,z));
}
}
s->build();

// [OGRE] create a skybox
mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");

// create NxWorld, a main physic object
// log: yes/no
// ogre time controller means rhat ogre will care about it
mNxWorld = new NxOgre::World("time-controller:ogre, log:yes");

// create scene, you can have maximum 32 scenes, object from one scene can't
// collide with objects from another (maybe in another versions :D )
// gravity: yes/no/0 -9.788 0
// floor: create infinity floor, yes/no
// ogre will be used as debug renderer
mNxScene = mNxWorld->createScene("NxOgreScene", mSceneMgr,"gravity:yes, floor:yes, renderer:ogre");

// create some boxes
createBox(Vector3(0,10,0));
createBox(Vector3(1,15,0));
// create small box
createBox(Vector3(2,30,0),0.5);

//mNxScene->createActor(new Terrain(
}
private:
// NxOgre stuff
World* mNxWorld;
Scene* mNxScene;
// number of objects, it's used to give unique names to new objects
int createdObjects;
};

KevinMulder

07-09-2008 21:32:16

I think, the ogre.log file would be much more help. My first wild guess would be that ogre.cfg is missing. Before running your first self-developed program, try to run one of Ogre demo. If it runs you have a working Ogre configuration and the ogre.cfg you can copy to your project, if demo is not working then Ogre is misconfigured and you will not be able to complie and run your own.

PeTkO

07-09-2008 21:44:46

Demo sample from OGRE is work fine, and my ogre projects too.I have ogre.cfg.Here you ogre.log:

http://rapidshare.com/files/143448773/Ogre.log.html

KevinMulder

07-09-2008 21:49:22

Sorry. The link tries to force me open a JavaScripted site. I do not open that for security reason.

Are you able to post only the last 15 lines of that file?

Do you still have the problem or everyting is working right?

PeTkO

07-09-2008 21:54:28

There is a error:

"OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource plane.mesh in resource group Autodetect or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp(line 753)"

KevinMulder

07-09-2008 21:57:47

It says it all: you have to configure the resources.cfg for your application.

Check this:
http://dundee.cs.queensu.ca/wiki/index. ... lling_Ogre

especiall this part:
Setting up Files Required for Runtime

It deals with resources.cfg

PeTkO

07-09-2008 22:09:00

I made plane.mesh, and my resources.cfg is ok.But, when I build and run, after black screen I get send/don't send error.I think that I go off with NxOgre...it's real complicated :(

KevinMulder

07-09-2008 22:14:52

It has nothing to do with NxOgre. But your project, your choice.

Prophet

07-09-2008 23:23:35

Default for meshes is ..\..\media\models. So if you have your execute at project\bin\release, you'll add your models to project\media\models, not the same as the excecutable.
As KevinMulder said, this is an Ogre-related problem, not NxOgre.

mcaden

08-09-2008 07:04:09

Did you look through it before you posted it?


22:26:11: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)
22:26:11: High-level program Ogre/ParticleGS/GenerateVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)
22:26:11: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)
22:26:11: High-level program Ogre/ParticleGS/DisplayVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)
22:26:11: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)
22:26:11: High-level program Ogre/ParticleGS/DisplayPS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
in CgProgram::loadFromSource at ..\src\OgreCgProgramManagerDll.cpp (line 66)


Extra shader stuff I suppose? Obviously Ogre errors, nothing to do with NxOgre.

and


22:26:11: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource plane.mesh in resource group Autodetect or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)


Real simple, it can't find plane.mesh


22:26:09: Parsing script deferred_post_minilight.hlsl.program
22:26:09: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightFalloff does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 1095)
22:26:09: Compiler error: invalid parameters in deferred_post_minilight.hlsl.program(27): setting of constant failed
...
22:26:10: Parsing script ASMSwizzle.material
22:26:10: Compiler error: object unsupported by render system in ASMSwizzle.material(1)



You have a ton of errors in ogre.log, none of which are related to NxOgre. It seems you're using a strange mish-mash of sample files but left others out, or they are samples from different versions of Ogre.