[NxOgre 0.9] Release mode problems

junkacc

18-04-2008 19:27:41

Hi,

I've compiled the source for NxOgre for both debug and release mode and the debug mode libraries compile and link fine with my current project. However when doing the same in release mode for my project I get a linker error.

The error is
1>Linking...
1>C_Physics.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __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@@QAE@XZ)
1>d:\My Documents\Pulse\Pulse\Pulse\run\Release\Pulse.exe : fatal error LNK1120: 1 unresolved externals


I have no idea how to fix this, so any help is much appreciated.

dekron

18-04-2008 19:38:50

it is a linking problem.

It is 99% sure either you don't have the good files/dlls versions, or they are not on the right place.

junkacc

19-04-2008 14:13:37

I've re-downloaded and built the libs again for NxOgre 0.9. I've tried both the debug and release mode versions and I'm getting the same results; the same link error with the release lib (debug lib is fine).

I'm using Physx SDK version 2.7.2 when compiling NxOgre with Visual Studio 2005 Professional Edition. After compilation of NxOgre I also get error messages, these are:

1>Performing Post-Build Event...
1>Copying DLL to CakeBox and Ogre Samples. Errors during copying process does not mean the library was built incorrectly.
1>The syntax of the command is incorrect.
1>The syntax of the command is incorrect.
1>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."
1>Build log was saved at "file://C:\Program Files\OgreSDK\lib\NxOgre\NxOgre\compiler\Windows\BuildLog.htm"
1>NxOgre - 1 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Could this be a problem or is this normal? The libs are still built which is what I'm using currently. I really need help with this because the project I'm working on is near completion and a release version needs to be built, so any help would be really helpful.

twilight17

19-04-2008 15:26:43

Oh that problem about the post-build error is nothing to worry about! anyway.. Here is a tutorial to get rid of it:

http://thingylol.110mb.com/tut.html

junkacc

20-04-2008 12:54:39

Thanks twilight17 for solving the build error.

Can anyone help me with my main problem? Just to restate it, I cannot build a release version of my project because I get this linker error:

1>Linking...
1>C_Physics.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __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@@QAE@XZ)
1>d:\My Documents\Pulse\Pulse\Pulse\run\Release\Pulse.exe : fatal error LNK1120: 1 unresolved externals


Looking at the error more closely is it not strange that it cannot find the destructor for that object? Shouldn't a default constructor be created if one is not implemented?

Anyway some useful information; I'm using PhysX SDK 2.7.2, compiling with Visual Studio 2005 Professional Edition with SP1, and the version of NxOgre I have compiled is 0.9.

If anyone has any ideas about how to solve this problem please shout them out even if you think it might be a stupid suggestion.

twilight17

20-04-2008 15:26:10

could you post all the libs you are linking to?

junkacc

20-04-2008 17:55:56

Here is the list of libraries I'm linking with in release mode:

OgreMain.lib
fmodex_vc.lib
xinput.lib
NxOgre.lib
PhysXLoader.lib
NXCooking.lib
NxCharacter.lib
NxExtensions.lib
winmm.lib


And just for reference here is the list of debug libraries I link with, which works:

OgreMain_d.lib
fmodex_vc.lib
xinput.lib
NxOgre_d.lib
PhysXLoader.lib
NXCooking.lib
NxCharacter.lib
NxExtensions.lib
winmm.lib

twilight17

21-04-2008 22:40:52

This is very weird... I don't see what could be causing this... Did you try to rebuild it completely, (I mean clean the project, then hit rebuild...)

It's obviously something wrong with Linking to NxOgre's library... so did you make sure that is built correctly?

Oh and make sure you leave everything where it is... Such as if you have the include files from NxOgre in your projects /include or if you have NxOgre's libs in your projects directory, delete them. Make sure they are only in NxOgre/lib and NxOgre/include (or wherever you installed it)

junkacc

26-04-2008 13:06:45

Hi, sorry for the late reply.

I did what you said but still no luck I get the same error in release mode again.

This is what I did: I re-downloaded NxOgre, rebuilt all the libraries and did not move any of the libraries or include files from where they are built. Then I linked to them from my project. The debug version of my project works perfectly but as I said the release version does not.

[Edit]
Oh forgot to mention that I also made sure that I cleaned and rebuilt both NxOgre and my project.
[End Edit]

I really really do not know what to do now! Are there any binary releases of NxOgre that I could download? I would only need the release version libraries and Dlls, unless there is anything else I can do.

Btw thanks for trying to help me twilight17, I really appreciate it!

junkacc

03-05-2008 18:28:52

I managed to get my program to link in release mode! Though I did not solve the actual underlying problem. How I did it was that I removed all actor iterators from my program and stored pointers to them manually. Therefore my program did not have to link to those functions and therefore got it to link.

So to summarise everywhere where I had something like:

NxOgre::Actors actsActorIdentity = p_scene->getActorsFromIdentifier( NxOgre::SO_STARTS_WITH, strCarNameID );
unsigned int uiPlayerNum = 0;

for( p_actCurrCar = actsActorIdentity.begin(); p_actCurrCar = actsActorIdentity.next(); ++ uiPlayerNum )


I removed and just used the list of pointers I had instead.

netsurferj

22-07-2008 13:17:50

Hi

I am having problems aswell when compiling in release mode, but mine is include files. One of the many errors is:
1>c:\physx\nxogre 0.9\include\NxOgrePrerequisites.h(303) : error C2146: syntax error : missing ';' before identifier 'NxThrow'

I have no idea why this is happening. I did not copy dlls or anything yet, as this does not seem like something that would change this (might be)

I am using PhysX v2.7.3, NxOgre 0.9 and Visual Studio.

(it compiles and runs fine in debug mode)