Unable to compile any example files for IrrNewt.

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
CheeseKeg
Posts: 2
Joined: Mon Jun 08, 2009 2:18 am
Location: Massachusetts, United States
Contact:

Unable to compile any example files for IrrNewt.

Post by CheeseKeg »

As a last resort, (I should have done this earlier) I am posting here to ask for your helping hand.
I spent hours today trying to work out tons of syntax errors that I was getting for IrrNewt examples. I even had to change some of the scripture in the included files for IrrNewt, but I just plain have no idea what a solution or alternative could be for this last linker error that I've been trying to work out..

I'm using Dev-C++.

The example file I am attempting to compile is ragdoll.cpp. (Though I have this same problem for anything that uses createBody() or createBodyAuto())

------------Here is the related code:----------------
----CODE:--------------------------------------------
---- //INI PHYSICS
---- p_world = irr::newton::createPhysicsWorld(device);
---- ragdoll_material = p_world->createMaterial();
---- world_material = p_world->createMaterial();
---- cube_material = p_world->createMaterial();
----
---- p_world->createBodyAuto(world_node, world_mesh)->setMaterial(world_material);
-------------------------------------------------------

------------Here is the linker error:-----------------
----CODE:--------------------------------------------
---- [Linker error] undefined reference to `_imp___ZN3irr6newton6IWorld14createBodyAutoEPNS_5scene10ISceneNodeEPNS2_5IMeshEfjNS_4core8CMatrix4IfEENS7_8vector3dIfEENS0_18E_CALCULATE_OFFSETENS0_16E_CALCULATE_SIZEE'
---- ld returned 1 exit status
-------------------------------------------------------
I bolded the function name in the linker error to show that they are related.

Here's what I tried:
Compiling with the latest version of Irrlicht as well as Irrlicht v1.2.
Using the createBody() function instead of createBodyAuto() with the same parameters.

If more information is needed to troubleshoot, feel free to request that I give it.

Any help/suggestions would be greatly appreciated!
- CheeseKeg.


By the way, the reason I didn't put the code in code blocks is because I wanted to highlight createBodyAuto in both.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Hmm did you pragma comented the irr newt lib ?
if not
write this :

Code: Select all

#pragma comment(lib, "IrrNewt.lib")
Working on game: Marrbles (Currently stopped).
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Re: Unable to compile any example files for IrrNewt.

Post by Malgodur »

CheeseKeg wrote: ------------Here is the related code:----------------
----CODE:--------------------------------------------
---- //INI PHYSICS
---- p_world = irr::newton::createPhysicsWorld(device);
---- ragdoll_material = p_world->createMaterial();
---- world_material = p_world->createMaterial();
---- cube_material = p_world->createMaterial();
----
---- p_world->createBodyAuto(world_node, world_mesh)->setMaterial(world_material);
-------------------------------------------------------
------------Heres my hint:--------------------------
----HINT:--------------------------------------------
---- //FOR CheeseKeg
---- you
---- should
---- use
----

Code: Select all

---- instead
---- of
----  ------------------------------- 
---- !!
---- because
---- it
---- keep
---- code
---- readable!
[b]-------------------------------------------------------[/b]
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Re: Unable to compile any example files for IrrNewt.

Post by Sylence »

CheeseKeg wrote: By the way, the reason I didn't put the code in code blocks is because I wanted to highlight createBodyAuto in both.
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 »

serengeor wrote:Hmm did you pragma comented the irr newt lib ?
if not
write this :

Code: Select all

#pragma comment(lib, "IrrNewt.lib")
He's using DevCpp so this pragma will be ignored... ;)
in DevCpp you'll need to add the lib to the linker settings !!!

and as standard advice for DevCpp users: try Code::Blocks instead, it's much better and still supported (DevCpp is not since a long time)... ;)
CheeseKeg wrote: By the way, the reason I didn't put the code in code blocks is because I wanted to highlight createBodyAuto in both.
you mean code tags, for sure... :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Or Visual Studio Express. But that is a matter of personal taste.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
CheeseKeg
Posts: 2
Joined: Mon Jun 08, 2009 2:18 am
Location: Massachusetts, United States
Contact:

Re: Unable to compile any example files for IrrNewt.

Post by CheeseKeg »

Malgodur wrote: ------------Heres my hint:--------------------------
----HINT:--------------------------------------------
---- //FOR CheeseKeg
---- you
---- should
---- use
----

Code: Select all

---- instead
---- of
----  ------------------------------- 
---- !!
---- because
---- it
---- keep
---- code
---- readable!
[b]-------------------------------------------------------[/b][/quote]

I see that you definitely had to have read my entire post..
I'm not blind, I can clearly see the CODE BBC, but due to the validity of my highlighting text within the code, and since it's only actually six to eight lines of code total (Only two that need any attention at all), I think you can abide to my post's format.
------

I appreciate the suggestions that everyone else is handing to me.

I am using Dev-C++. (as mentioned in my first post)

Here are the linked libraries:

[code]../../lib/win32-gcc/libIrrNewt.a
../../../Irrlicht/irrlicht-1.5/lib/Win32-gcc/libIrrlicht.a
../../../NewtonSDK/sdk/dll/Newton.lib
I assure you that all of the locations are valid and the libraries do exist in those directories
RodrigoAmazonas
Posts: 24
Joined: Mon May 25, 2009 2:18 pm
Location: Brazil
Contact:

Post by RodrigoAmazonas »

Hey! I'm getting a similar problem. I've downloaded the ShTlTerrainSceneNode and was trying to compile it. I only had to change a single line

scene::E_DEBUG_SCENE_TYPE dtype = terrain->isDebugDataVisible();

to

scene::E_DEBUG_SCENE_TYPE dtype = scene::E_DEBUG_SCENE_TYPE(terrain->isDebugDataVisible());

I thought typecasting should be automatic, since scene::E_DEBUG_SCENE_TYPE is an ENUM, and terrain->isDebugDataVisible() returns a s32, shouldn't it? But now it keeps telling that

main.cpp||undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverE'|
main.cpp||undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverE'|
main.cpp||undefined reference to `ShTlTerrainSceneNode::ShTlTerrainSceneNode(irr::scene::ISceneManager*, int, int, float, int, irr::scene::ISceneNode*, int)'|
||=== Build finished: 3 errors, 0 warnings ===|

I have unzipped the demo and source to the same folder, and added that folder to the Compiler and Linker search directories. What else should be done? I've got the same error in Dev-C++ and Code::Blocks. I'm using IrrLicht 1.5 under Windows XP.

Thanks in advance!
I feel, therefore I am.
RodrigoAmazonas
Posts: 24
Joined: Mon May 25, 2009 2:18 pm
Location: Brazil
Contact:

Post by RodrigoAmazonas »

For the case anyone run into a similar problem:

Project options:
Search directories:
Compiler:
......irrlicht-1.5\include
Linker:
......irrlicht-1.5\lib\Win32-gcc (or anyone you're using)

and
Linker settings:
Link libraries:
......irrlicht-1.5\lib\Win32-gcc\libIrrlicht.a

That's all!
I feel, therefore I am.
Post Reply