IrrNewt linker error - VS2005

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.
Post Reply
dybalabj
Posts: 6
Joined: Mon Oct 29, 2007 6:42 pm

IrrNewt linker error - VS2005

Post by dybalabj »

I know this is probably a simple question and the answer is somewhere on the forums, but I just can't find it. When I try to compile my code with IrrNewt, I get the following linker error:

Code: Select all

main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class irr::newton::IBody * __thiscall irr::newton::IWorld::createBody(class irr::scene::ISceneNode *,class irr::scene::IMesh *,enum irr::newton::E_BODY_TYPE,float,class irr::core::matrix4,class irr::core::vector3d<float>,enum irr::newton::E_CALCULATE_OFFSET,enum irr::newton::E_CALCULATE_SIZE)" (__imp_?createBody@IWorld@newton@irr@@QAEPAVIBody@23@PAVISceneNode@scene@3@PAVIMesh@63@W4E_BODY_TYPE@23@MVmatrix4@core@3@V?$vector3d@M@core@3@W4E_CALCULATE_OFFSET@23@W4E_CALCULATE_SIZE@23@@Z) referenced in function _main
..\..\bin\Win32-VisualStudio\HelloWorld.exe : fatal error LNK1120: 1 unresolved externals
The lines that use IrrNewt are the following:

Code: Select all

#include <irrlicht.h>
#include <irrNewt.hpp>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "IrrNewt.lib")
....
	// Init physics w/ IrrNewt
	newton::IWorld* physics_world = newton::createPhysicsWorld(device);

	// create collision b/w AI and Player
	newton::IBody *Player_body = physics_world->createBody(Player);
	newton::IBody *AI_body = physics_world->createBody(AI);

	newton::ICollision *Car_collision = new newton::ICollision(physics_world);
	Player_body->setCollision(Car_collision);
	AI_body->setCollision(Car_collision);
Basically I have 2 racecars and I'm trying to set up collision b/w them. I'm not even sure if my code is correct, I'm just now learning how to use irrnewt. Anyway, before I added the #pragma comment(lib, "IrrNewt.lib") line, I had 3 other linker errors referencing my other function calls. The only suggestions I have found in any forums are to add the #pragma comment line, but that's already done. My setup is:
Windows XP SP2
Visual Studio 2005 Standard Edition
Irrlicht 1.1
IrrNewt 0.4
Newton 1.53

Any suggestions would be greatly appreciated.

- Dybs
Mux
Posts: 56
Joined: Mon Feb 26, 2007 12:25 pm
Location: Stockholm

Post by Mux »

When I get the "unresolved external symbol" error I usualy add the path(s) to the lib files I use in the "Additional Library Directories"-field in the project property page.

Project -> Properties... -> Configuration Properties -> Linker -> General

Then it works for me.
Post Reply