Irrphysx link error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Irrphysx link error

Post by Adler1337 »

Hello
I am trying to learn Irrphysx, but when i add the lines

Code: Select all

physxManager = createPhysxManager(device, sceneDesc, false);
removePhysxManager(physxManager);
I get two linker errors:
error LNK2001: unresolved external symbol "void __cdecl IrrPhysx::removePhysxManager(class IrrPhysx::IPhysxManager *)" (?removePhysxManager@IrrPhysx@@YAXPAVIPhysxManager@1@@Z)

error LNK2001: unresolved external symbol "class IrrPhysx::IPhysxManager * __cdecl IrrPhysx::createPhysxManager(class irr::IrrlichtDevice *,struct IrrPhysx::SSceneDesc const &,bool)" (?createPhysxManager@IrrPhysx@@YAPAVIPhysxManager@1@PAVIrrlichtDevice@irr@@ABUSSceneDesc@1@_N@Z)

One error for each of the lines of code. Does anybody know why this is happening and how to fix it?
multum in parvo
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You have to link with the library that is inside the IrrPhysx SDK.
I am sure that this is covered in the tutorials / readme of IrrPhysx
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Sorry to sound like an idiot, but how do i do that? I looked at the readme and tutorials, but i didn't see anything. :?
multum in parvo
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

linking with external libraries is a basic step for programming. we could help you here, but I think we do you more help by asking you to get a basic programming book and read up on it. you dont need the latest greatest $85.00 Amazon book. You can pick these up at any used book store for a few dollars. trust me, reading a little bit on these basics will leap your programming skills far more than us telling you how to link a library.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I've been looking online for an answer, but every time i try something i just get more errors. If you can help me, then do it. Don't tell me to buy a book. I can learn the same if you tell me and i fix the error now, or i take a couple of days and find some outdated book.
multum in parvo
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

if I can help you then do it? wow.... good luck in your endeavors.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Sorry to sound rude. :oops: I was using the Heightfield example, but when i compile it i get a similar error. When i am just using irrlicht and not irrphysx, i normally use a pragma comment to link to the lib. I have tried that for irrphysx, but i get these errors:

Linking...
1>IrrPhysx.lib(IrrPhysx.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>IrrPhysx.lib(CPhysxManager.obj) : error LNK2001: unresolved external symbol __imp__NxReleasePhysicsSDK
1>IrrPhysx.lib(CPhysxManager.obj) : error LNK2001: unresolved external symbol __imp__NxCreatePhysicsSDK
1>IrrPhysx.lib(Cooking.obj) : error LNK2001: unresolved external symbol __imp__NxGetCookingLib

I have also tried going to project->properties->linker and adding it there, but i keep getting errors. Once again Seven, i am sorry, but i didn't want figuring this out to take more than a couple of hours, since i seems to be so simple.
multum in parvo
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

#pragma comment(lib, "PhysxLoader.lib")
#pragma comment(lib, "NxCharacter.lib")
#pragma comment(lib, "NxCooking.lib")


I cant speak directly to IrrPhsx as I modified it some and cant remember exactly whatI have to add to it. seems that I that i had to add the above to it though....
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks for the help, especially after i was such an @ss. But it says it can't open the files.
multum in parvo
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

Adler1337 wrote:Thanks for the help, especially after i was such an @ss. But it says it can't open the files.
np, the lib's are in the Physx SDK folder (not Irrphysx, but the physx sdk folder) . If you search your harddrive you will find them deep in the sdk folder.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

ok thanks.
multum in parvo
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I haven't had much time to work on it, but i think found all of the lib i need to link to. I tried the code you provided, but it keeps saying it can't open the files. I'm not sure what is going on, but any suggestions are greatly appreciated.
multum in parvo
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Just set up the linker in the properties, pointing to the specific libraries requried, that's how all the IrrPhysx examples are setup.
Image Image Image
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I think i have it set up correctly, but i am still getting the link errors:

Error 1 error LNK2019: unresolved external symbol "void __cdecl IrrPhysx::removePhysxManager(class IrrPhysx::IPhysxManager *)" (?removePhysxManager@IrrPhysx@@YAXPAVIPhysxManager@1@@Z) referenced in function _wmain Mars.obj

Error 2 error LNK2019: unresolved external symbol "class IrrPhysx::IPhysxManager * __cdecl IrrPhysx::createPhysxManager(class irr::IrrlichtDevice *,struct IrrPhysx::SSceneDesc const &,bool)" (?createPhysxManager@IrrPhysx@@YAPAVIPhysxManager@1@PAVIrrlichtDevice@irr@@ABUSSceneDesc@1@_N@Z) referenced in function _wmain Mars.obj
I have it set up just like i normally set up irrlicht, except i added the directories for irrphysx and Physx. Am i still missing a pragma comment?
Here is what i got:
#include <irrlicht.h>
#include "stdafx.h"
#include <IrrPhysx.h>
#include <MastEventReceiver.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace IrrPhysx;

#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "PhysxLoader.lib")
#pragma comment(lib, "NxCharacter.lib")
#pragma comment(lib, "NxCooking.lib")
multum in parvo
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Might help linking to IrrPhysx.lib too ;)
Image Image Image
Post Reply