Help with IPhysics

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
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Help with IPhysics

Post by n00b »

Hi,
I can't compile my project using IPhysics.
The problem is when linking.
The message that appears is:

.objs\main.o:main.cpp:(.text+0x13e): undefined reference to `CPhysics::CPhysics()'
.objs\main.o:main.cpp:(.text+0x167): undefined reference to `CPhysics::init(irr::ITimer*)'
.objs\main.o:main.cpp:(.text+0x28d): undefined reference to `CPhysics::addEntity(SPhysicsCube*)'
.objs\main.o:main.cpp:(.text+0x3fe): undefined reference to `CPhysics::addEntity(SPhysicsCube*)'
.objs\main.o:main.cpp:(.text+0x492): undefined reference to `CPhysics::update()'
.objs\main.o:main.cpp:(.text+0x502): undefined reference to `CPhysics::~CPhysics()'
.objs\main.o:main.cpp:(.text+0x529): undefined reference to `CPhysics::~CPhysics()'
collect2: ld returned 1 exit status

Can anyone help?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

looks like you didn't add the IPhysics files to your project
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Post by n00b »

What do you mean by adding the IPhysics files to my project?
Do you mean including them? I've done that.
I've linked both Newton.lib and IPhysics.lib and included both.
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Post by pinkman »

~If your using Dev C++

Are the include folder files in the compilers include folder or not? If not you have to include them manually with Project Options->Directories->Include Directories then add the folder the IPhysics include files are in to it. Also, you may wanna put IPhysics at top, of the included directories list.
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Post by n00b »

No, i'm using code::blocks.
I've included all the IPhysics, Newton and Irrlicht files manually in the project build options.
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

I also get these linker errors in Dev C++

I have put the include folder in the include section of directories in project options, the library folder in the library section and the .lib in the linker section in parameters.

I've even tried the .a available.
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

I just tried compiling the example source with all the project options set up, and I get this:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -D__DEBUG__ -c ../Gooball/IPhysics-1.2/examples/examples_source/main.cpp -o ../Gooball/IPhysics-1.2/examples/examples_source/main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Gooball/IPhysics-1.2/include" -I"C:/NewtonSDK/sdk" -I"C:/irr/include" -g3 -mwindows

In file included from ../Gooball/IPhysics-1.2/examples/examples_source/main.cpp:5:
../Gooball/IPhysics-1.2/examples/examples_source/global.h:32:7: warning: no newline at end of file
In file included from ../Gooball/IPhysics-1.2/examples/examples_source/main.cpp:6:
../Gooball/IPhysics-1.2/examples/examples_source/example1.h:68:2: warning: no newline at end of file
In file included from ../Gooball/IPhysics-1.2/examples/examples_source/main.cpp:7:
../Gooball/IPhysics-1.2/examples/examples_source/example2.h:96:2: warning: no newline at end of file
In file included from ../Gooball/IPhysics-1.2/examples/examples_source/main.cpp:8:

../Gooball/IPhysics-1.2/examples/examples_source/example3.h:178:2: warning: no newline at end of file
../Gooball/IPhysics-1.2/examples/examples_source/main.cpp:31:2: warning: no newline at end of file

g++.exe -D__DEBUG__ ../Gooball/IPhysics-1.2/examples/examples_source/main.o -o "test.exe" -L"C:/Dev-Cpp/lib" -L"C:/irr/lib/Win32-gcc" -L"C:/NewtonSDK/sdk/dll" -L"C:/Gooball/IPhysics-1.2/lib" ../Gooball/IPhysics-1.2/lib/IPhysics.lib -g3 -mwindows

../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xa8): In function `ZN18CEventReceiver_eg27OnEventEN3irr6SEventE':

C:/irr/include/IEventReceiver.h: undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x170):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x19e):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::init(irr::ITimer*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x2d5):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::addEntity(SPhysicsCube*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x471):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::addEntity(SPhysicsCube*)'

../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x58c):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::update()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x5c4):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x600):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x6c6): In function `Z11runExample2v':
C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:45: undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x78e):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:59: undefined reference to `CPhysics::CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x7b9):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:60: undefined reference to `CPhysics::init(irr::ITimer*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xa5f):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:84: undefined reference to `CPhysics::addEntity(SPhysicsTerrain*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xb25):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:93: undefined reference to `CPhysics::update()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xbab):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:93: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xbe4):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example2.h:93: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xcaa): In function `Z11runExample3v':
C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:96: undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'

../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xe0f):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:113: undefined reference to `CPhysics::CPhysics()'

../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0xe3d):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:114: undefined reference to `CPhysics::init(irr::ITimer*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x1516):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:151: undefined reference to `CPhysics::addCar(SPhysicsCar*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x16e8):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:167: undefined reference to `CPhysics::addEntity(SPhysicsStaticMesh*)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x17b1):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:176: undefined reference to `CPhysics::update()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x1840):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:176: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text+0x187c):C:/Dev-Cpp/../Gooball/IPhysics-1.2/examples/examples_source/example3.h:176: undefined reference to `CPhysics::~CPhysics()'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text$_ZN18CEventReceiver_eg27OnEventEN3irr6SEventE[CEventReceiver_eg2::OnEvent(irr::SEvent)]+0x65): In function `ZN18CEventReceiver_eg27OnEventEN3irr6SEventE':
C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::dropTestCube(irr::scene::ISceneManager*, irr::core::vector3d<float>, float, float)'
../Gooball/IPhysics-1.2/examples/examples_source/main.o(.text$_ZN18CEventReceiver_eg27OnEventEN3irr6SEventE[CEventReceiver_eg2::OnEvent(irr::SEvent)]+0xc0):C:/irr/include/IEventReceiver.h: undefined reference to `CPhysics::dropTestSphere(irr::scene::ISceneManager*, irr::core::vector3d<float>, float, float)'
collect2: ld returned 1 exit status

make.exe: *** [test.exe] Error 1

Execution terminated
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Post by n00b »

Hi, dwfait,

When you're compiling the project, how long does the linking take?
My project takes 5 minutes to link only! If i dont link with IPhysics, it takes 23 seconds. Why?

Anyway, the error you get, its exactly the same as mine. Does anyone know how to fix this?
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

It's pretty fast compiling / linking for me...always under 5 seconds. Although my program is only a very small test program.
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

You cant work with .a using iphysics for now, cause the .a file online is v1.1 and the package for iphysics is 1.2 so its gonna cause probs! Only .lib supporting compilers for now!
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

Thanks, but I've been trying it with the .lib aswell and still no worky :(
dwfait
Posts: 28
Joined: Sun Sep 24, 2006 8:13 pm

Post by dwfait »

Is there an old version of IPhysics that works with the .a, or an updated version of the .a somewhere?
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

I just compiled up a .a for Irrlicht 1.2, IPhysics 1.2, and the latest Newton release(Not sure which one that is).

PM me if ya need it :)
Post Reply