iphysics help

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
killsto
Posts: 10
Joined: Sat Mar 28, 2009 6:30 pm

iphysics help

Post by killsto »

Fixed.
Last edited by killsto on Mon Mar 30, 2009 1:13 am, edited 1 time in total.
Brkopac
Posts: 88
Joined: Fri Sep 19, 2008 2:36 am

Re: iphysics help

Post by Brkopac »

killsto wrote:I'm trying to use Iphysics for fun. I've downloaded it, linked it, and tried to compile the hello world. At first, I realized the documentation is out of date because the CPhysics initializer requres an ITimer pointer. I fixed that and now get this:

Code: Select all

1>Linking...
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CPhysics::~CPhysics(void)" (??1CPhysics@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CPhysics::update(float)" (?update@CPhysics@@QAEXM@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: class IPhysicsEntity * __thiscall CPhysics::addEntity(struct SPhysicsCube *)" (?addEntity@CPhysics@@QAEPAVIPhysicsEntity@@PAUSPhysicsCube@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CPhysics::init(class irr::ITimer *)" (?init@CPhysics@@QAEXPAVITimer@irr@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CPhysics::CPhysics(void)" (??0CPhysics@@QAE@XZ) referenced in function _main
1>C:\Documents and Settings\Killian\My Documents\Visual Studio 2008\Projects\testing\Debug\irrlicht_test.exe : fatal error LNK1120: 5 unresolved externals
I'm using Irrlicht 1.4.2, newton 1.53, and Iphysics 1.2. Is there a more recent version? I can't find one.
You're not linking to the proper libraries.
Image - The glory days.
killsto
Posts: 10
Joined: Sat Mar 28, 2009 6:30 pm

Post by killsto »

I kind of guessed at linking. There is no documentation at all about newton linking, and there are multiple link folders.
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

The newton libs are linked correctly. The IPhysics libs aren't.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

it also could be the order of the libs !!!
I link first to libNewton.a and after that to libIPhysics.a and it works !!!
If I link first to IPhysics then I'll get linker errors... :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
killsto
Posts: 10
Joined: Sat Mar 28, 2009 6:30 pm

Post by killsto »

I guess I don't understand how to link properly under Visual Studio. I went Tools->Options and added new include and lib directories. That worked for Irrlicht, so I assumed it would work for IPhysics. How do I do it?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

just adding the directories is not enough...
did you also link against the IPhysics and Newton libs ???
for VS it is usually a pragma statement at the beginning of the main.cpp (like the one for Irrlicht.lib)... ;)
so it should look something like this:

Code: Select all

#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "IPhysics.lib")
#pragma comment(lib, "Newton.lib")
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
killsto
Posts: 10
Joined: Sat Mar 28, 2009 6:30 pm

Post by killsto »

I'm now getting this:

Code: Select all

1>IPhysics.lib(CPhysics.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 LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2001: unresolved external symbol "class irr::IrrlichtDevice * __cdecl irr::createDevice(enum irr::video::E_DRIVER_TYPE,class irr::core::dimension2d<int> const &,unsigned int,bool,bool,bool,class irr::IEventReceiver *,char const *)" (?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@PBD@Z)
1>C:\Documents and Settings\Killian\My Documents\Visual Studio 2008\Projects\testing\Debug\irrlicht_test.exe : fatal error LNK1120: 1 unresolved externals
Does this mean I need an older version of Irrlicht?
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

killsto wrote:I'm now getting this:

Code: Select all

1>IPhysics.lib(CPhysics.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 LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2001: unresolved external symbol "class irr::IrrlichtDevice * __cdecl irr::createDevice(enum irr::video::E_DRIVER_TYPE,class irr::core::dimension2d<int> const &,unsigned int,bool,bool,bool,class irr::IEventReceiver *,char const *)" (?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@PBD@Z)
1>C:\Documents and Settings\Killian\My Documents\Visual Studio 2008\Projects\testing\Debug\irrlicht_test.exe : fatal error LNK1120: 1 unresolved externals
Does this mean I need an older version of Irrlicht?
and how did u fix this error!!?
Post Reply