Can't get OgreNewt to work

DrGonzo

04-03-2009 15:33:53

Hi,

I'm having trouble getting OgreNewt to work, I seem to be unable to generate a .lib file from what I downloaded and compiled, also, I seem not to have a OgreNewt_Main folder after compilation, as I've seen displayed on several sites. Or is this hierarchy no longer supported in OgreNewt?

I'm using:
Ogre 1.6.1 (Shoggoth)
OgreNewt (svn, https://svn.ogre3d.org/svnroot/ogreaddo ... t/newton20)
Newton 2.0
CMake 2.6.3


I used CMake to generate a .sln project file, I'm using Microsoft Visual Studio 2008 to build and compile OgreNewt. It finds Ogre, it finds Newton, no errors there.

When I open the .sln file, I see 5 different projects: "ALL_BUILD, INSTALL, OgreNewt, PACKAGE, ZERO_CHECK", but only OgreNewt contains a folder with source files.

When it compiles in Debug mode, it generates following files:

Debug/OgreNewt.dll
Debug/OgreNewt.idb
Debug/OgreNewt.ilk
Debug/OgreNewt.pdb

And in Release mode:

Release/OgreNewt.dll
Release/OgreNewt.idb


Now I tried some combinations, and even tried to follow a tutorial I found (http://www.newtondynamics.com/wiki/inde ... ners_guide), but it kept on throwing errors. Now it does autocomplete when I type 'OgreNewt::', as it finds that info in the header file, and has probably nothing to do with my error.


Any idea what could be wrong here?


Thanks in advance,


DrGonzo

E: The 2 errors I get when I try to create a new world object in the constructor are:

Error 1 error LNK2019: unresolved external symbol "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ) referenced in function "public: __thiscall OgreNewtApplication::OgreNewtApplication(void)" (??0OgreNewtApplication@@QAE@XZ) OgreNewtApplication.obj Ogre_Tutorial1
Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Ogre_Tutorial1\Debug\Ogre_Tutorial1.exe Ogre_Tutorial1

DrGonzo

11-03-2009 14:06:51

I checked the version thread, and saw a version was posted to svn that included a VS2008 .sln file, I downloaded this code, and it works so far.

Now I'm off to try the demo's.

melven

11-03-2009 19:23:57

It seems that the vc project files created by cmake don't really work... I'll try to commit working vc project files (for VS2008 it should work now, the other versions need to be checked!)

It's possible that the project files created by cmake for the demo don't work, so you should better create them by yourself... It would be nice if you tell me if the demos are working for you, I only tested them on my pc.

DrGonzo

11-03-2009 22:33:09

It seems that the vc project files created by cmake don't really work... I'll try to commit working vc project files (for VS2008 it should work now, the other versions need to be checked!)

It's possible that the project files created by cmake for the demo don't work, so you should better create them by yourself... It would be nice if you tell me if the demos are working for you, I only tested them on my pc.


I've been trying to get the first demo to work ('The Basics'). I just added the .h and .cpp files to a new project.
I'm still getting 2 linker errors:


Error 1 error LNK2019: unresolved external symbol "public: __thiscall OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class Ogre::SceneManager *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVSceneManager@3@PAVWorld@1@H@Z) referenced in function "protected: virtual void __thiscall OgreNewtonApplication::createFrameListener(void)" (?createFrameListener@OgreNewtonApplication@@MAEXXZ) OgreNewtonApplication.obj OgreNewt_Demo1
Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\OgreNewt_Demo1\Debug\OgreNewt_Demo1.exe OgreNewt_Demo1



But I've searched the forums, and saw this error pop up quite a few times, so perhaps there is a simple solution for this.

These are the additional include directories I use:
C:\OgreNewt\inc
C:\NewtonWin-2.00\sdk
C:\OgreSDK\include
C:\OgreSDK\samples\include

These are the additional library directories:
C:\OgreNewt\lib
C:\NewtonWin-2.00\sdk\x32\dll_vs9
C:\OgreSDK\lib

The additional dependencies I've added to the project:
OgreMain_d.lib
OIS_d.lib
newton.lib
OgreNewt_d.lib


Any idea if there's anything missing?
Also, I've given each component it's own folder on the C:\ drive, I hope this doesn't cause conflicts, as there was some advice on the forums to use a specific directory structure.

melven

11-03-2009 23:24:23

I suppose it's an error in the OgreNewt project file: You need perhaps to add the file src/OgreNewt_BasicFrameListener.cpp to the OgreNewt project file... it's possibly just missing in the OgreNewt project!

DrGonzo

11-03-2009 23:53:32

The file src/OgreNewt_BasicFrameListener.cpp was indeed not in the project, I added it, but src/OgreNewt_BasicFrameListener.h was.

Afterwards it complained about something related to OIS, but after linking it to the project, it built.

The Demo also builds. I've got an exe!

I copied it into the directory where the Ogre DLL's were located (I had to do this for the original Ogre tutorials as well),
and added the Newton and OgreNewt dll's there as well.

Now the demo starts, and I get to pick my renderer, but gives me a HEAP CORRUPTED error after the screen is black.

My 'regular' Ogre examples still work though.

The error says:

Debug error!
Program: C:\OgreSDK\bin\debug\OgreNewt_Demo1.exe

HEAP CORRUPTION DETECTED: after Normal block (#345) at 0x026F9AD0
CRT detected that the application wrote to memory after end of heap buffer.

(Press Retry to debug the application)

Abort | Retry | Ignore


Clicking Retry gives a 'This program has caused an error and needs to close dialog", so not much help there.

melven

12-03-2009 14:11:40

Ok, thanks... I'll probably ask someone to check the demos on windows!