NxOgre::Container

JoshPendergrass

27-11-2007 06:24:21

Trying to change from a container class I made to the NxOgre Container.
Using:

NxOgre (NxOgre 0.9-38.Debug) Started, working with:

- PhysX => 2.7.2
- Ogre => 1.4.2 'Eihort'
- Platform => Windows Debug


When I add the line:

NxOgre::Container<NxOgre::NxString, mech *> mMechList;

I get these errors:

1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall NxOgre::Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class mech *>::~Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class mech *>(void)" (__imp_??1?$Container@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVmech@@@NxOgre@@QAE@XZ) referenced in function __unwindfunclet$??0game@@QAE@PAVmain_ogre@@PAVmain_sound@@@Z$0
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall NxOgre::Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class mech *>::Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class mech *>(void)" (__imp_??0?$Container@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVmech@@@NxOgre@@QAE@XZ) referenced in function "public: __thiscall game::game(class main_ogre *,class main_sound *)" (??0game@@QAE@PAVmain_ogre@@PAVmain_sound@@@Z)
1>Mecha Lord.exe : fatal error LNK1120: 2 unresolved externals


The error in the NxOgre.log file

NxOgre::Error::reportError#78T0 F0

PhysX Error (NXE_DB_WARNING) 'createActor: Dynamic triangle mesh instantiated!' in line 1108 of g:\scm\release\PhysX_2.7.2\novodex\SDKs\Physics\src\Actor.cpp


I'm fairly certain it has something to do with the way my project is set up, but can't seem to find whats missing, any ideas?

Thanks in advance :)

betajaen

27-11-2007 09:27:30

It's a bug with Visual Studio. You need to prefix a macro to the NxOgre container functions.

http://www.ogre3d.org/phpBB2addons/view ... 3765#33765

JoshPendergrass

27-11-2007 19:35:02

Hi, thanks for the fast response.
Added NX_INLINE to all the methods in the Container Class, triple checked to be sure I got them all. copied the .dll to same folder as .exe, but still receiving same error
Am using VS 2005.

Spanky

30-12-2007 02:38:33

I'm having the same problem as well. I'm using Visual Studio 2005 with SP1 installed. I've placed the NX_INLINE on all the methods as well as tried to implement an empty default constructor/destructor.

These are the errors that I'm still getting.


1>PhysicsManager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall NxOgre::Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class NxOgre::Actor *>::~Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class NxOgre::Actor *>(void)" (__imp_??1?$Container@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVActor@NxOgre@@@NxOgre@@UAE@XZ)

1>PhysicsManager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const NxOgre::Container<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class NxOgre::Actor *>::`vftable'" (__imp_??_7?$Container@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVActor@NxOgre@@@NxOgre@@6B@)


Any help would be appreciated. I'm unable to run in Release mode and it's hella slow in Debug :)

Thanks
Shawn

betajaen

30-12-2007 15:29:44

I believe I managed to fix it. It's do with the project settings in NxOgre. Currently my NxOgre is on a DVD at a moment, after a long and painful, and unnecessary reinstall.

But you can do what I did. Load up the Ogre solution, and look at the OgreMain properties in Release mode, and basically copy over the same settings (except for paths, and names for things; obviously), recompile NxOgre and in theory it should work then.