LNK2019 Error


18-11-2006 17:16:52

Hey, first time posting, have lnkerror problem
Running tutorials fine but when i try to create my own project i get this error
[quote]BeerPong.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::ControllerManager(void)" (__imp_??0ControllerManager@@QAE@XZ) referenced in function _$E1
BeerPong.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::~ControllerManager(void)" (__imp_??1ControllerManager@@QAE@XZ) referenced in function _$E2
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
..\bin\Release/BeerPong.exe : fatal error LNK1120: 3 unresolved externals

i've looked at the older forums with this error and it has seemed to be small as adding a .lib file..
i've tried even getting all the .lib files from NxOgre, PhysX, and Ogre and putting it into one file. I have even tried adding the project to the tutorial projects and it still will not run... if you need to see the code just let me know... any suggestions


18-11-2006 17:40:57

Hmm, make sure your including NxOgre before Ogre.


18-11-2006 17:45:51

yeah i've created a header file that has all the headers in it.
#include "NxOgre.h"
#include "BeerPongApplication.h"
#include "Ogre.h"
#include "OgreConfigFile.h"
#include "OgreKeyEvent.h"
#include "OgreEventListeners.h"
#include "OgreStringConverter.h"
#include "OgreException.h"

and i also have even tried the controllermanager typedef which didnt work


18-11-2006 17:56:51

If you did that above, is it included in every source file at the utmost top (first)?

Are you using your own Singleton?

To be safe, NxOgre.h must be first everywhere you use it or sometimes not.


18-11-2006 18:04:53

yeah that code was in my own header which is included the header and the cpp file that i have created...the application header file that i am using is almost identical to the tutorialSimple, i just basically took out the createPlane()
and the cpp file is Tutorial 102 but i took out the box and the sphere and replaced it with my room, it still creates a world a scene and a body
and the body i changed to a static body


18-11-2006 18:20:37

How about compiling and running the tutorials alone? No customization to the source files.


18-11-2006 18:23:35

tutorials compile perfectly...i tried to create my own project it didn't work,
so i decided start w/ a tutorial that didn't work so i added the project to the nxtutorial.sln and to see if i was doing anything wrong and i am still getting the same error


18-11-2006 18:46:09

if it helps any i'm using VS2003 + PhysX 2.5.1 + NxOgre 0.5.Preview 3.0 + Ogre 1.2.4 src


18-11-2006 18:52:07

the next possible thing i might do is go to Preview 2 and upgrade to 2.6 of PhysX and see how it works then


18-11-2006 18:55:12

Well that explains things.

Use NxOgre 0.4RC2 and PhysX 2.6.2


19-11-2006 03:21:42

appreciate it, i will update and let you know how it went


19-11-2006 04:19:49

Way off topic, but you have some confusing version numbers there betajaen.


19-11-2006 09:01:07

I know. I wanted NxOgre finished by the end of this year; 0.5 but it doesn't look like it so I went back a step to 0.4.


19-11-2006 22:33:13

alright, i've have the NxOgre 0.4RC2 and PhysX 2.6.2 download and compiled perfectly, when i run the NxOgre tutorials it gives me an error inside ogre.graphics.log
Error #: -2005530516
Function: D3D9RenderSystem::_render
Description: Failed to DrawPrimitive : Invalid call.
File: ..\src\OgreD3D9RenderSystem.cpp
Line: 2500
Stack unwinding: <<beginning of stack>>

and it throws me and exception at this line
17:13:32: Texture: spot_shadow_fade.png: Loading 1 faces(PF_B8G8R8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
17:13:32: An exception has been thrown!

i saw on another tutorial that the guy had an older version of DirectX
i have the August edition and when i downloaded the PhysX 2.6.2 it download the October Version

and as before the spot_shadow_fade.png is not in Ogre or NxOgre media


19-11-2006 23:28:30

i also did your mousePicker.h hack
and that didn't seem to work

The screen pops up you see load and then it closes down

any suggestions


20-11-2006 09:19:54

Hmm. The hack is in RC2.

It sounds like an Ogre problem with the shadows, you could try adjusting tutorialApplicationDagon.h not to have any shadows and see how it goes.


21-11-2006 15:49:53

that didn't seem to work, i get the same error
it still goes to the loading screen and then closes
some times it freezes the whole system


21-11-2006 16:03:37

it throws an exception at arrow1.png instead of spot_shadow_fade.png


28-11-2006 16:14:42

I get similar LNKError (LNK2019) refering to the ControllerManager.
I am including nxOgre before Ogre, and I have tried on a the sample framework.
This is really slowing down our team uni project, any ideas?

test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::ControllerManager(void)" (__imp_??0ControllerManager@@QAE@XZ) referenced in function "void __cdecl nxOgre::`dynamic initializer for 'mControlMgr''(void)" (??__EmControlMgr@nxOgre@@YAXXZ)

test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::~ControllerManager(void)" (__imp_??1ControllerManager@@QAE@XZ) referenced in function "void __cdecl nxOgre::`dynamic atexit destructor for 'mControlMgr''(void)" (??__FmControlMgr@nxOgre@@YAXXZ)

bin\Debug\test.exe : fatal error LNK1120: 2 unresolved externals


28-11-2006 16:22:24

Just to confirm, regarding the previous post.
I am using:
NxOgre 0.4RC2 and PhysX 2.6.2 and VS2005


28-11-2006 17:08:24

Got it working. My project properties weren't setup properly.
For future reference, here are the working ones:

Project Properties --> Linker --> Input --> Additional Dependancies:
OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib PhysXLoader.lib NxCooking.lib NxCharacter.lib nxOgre.lib

Project Properties --> Linker --> General --> Additional Library Dirs: