[solved*ish]irrBullet help, MSVC 2008

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
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

[solved*ish]irrBullet help, MSVC 2008

Post by jibblesmgee »

ok, I've been struggling to get irrbullet 1.71 to work with MSVC 2008.

I'm using the latest irrlicht release.

My code is fine as far as I know but the linker gives me these 3 ridiculously enourmous errors:

1>main.obj : error LNK2019: unresolved external symbol __imp__createDevice referenced in function _main
1>irrBullet.lib(softbody.obj) : error LNK2019: unresolved external symbol __imp___invalid_parameter_noinfo referenced in function "public: bool __thiscall std::_Tree<class std::_Tmap_traits<struct btSoftBody::Node *,int,struct std::less<struct btSoftBody::Node *>,class std::allocator<struct std::pair<struct btSoftBody::Node * const,int> >,0> >::const_iterator::operator==(class std::_Tree<class std::_Tmap_traits<struct btSoftBody::Node *,int,struct std::less<struct btSoftBody::Node *>,class std::allocator<struct std::pair<struct btSoftBody::Node * const,int> >,0> >::const_iterator const &)const " (??8const_iterator@?$_Tree@V?$_Tmap_traits@PAUNode@btSoftBody@@HU?$less@PAUNode@btSoftBody@@@std@@V?$allocator@U?$pair@QAUNode@btSoftBody@@H@std@@@4@$0A@@std@@@std@@QBE_NABV012@@Z)
1>..\..\bin\Win32-VisualStudio\Rockman.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Justin\Desktop\irrlicht-1.7.2\Rockman\Rockman\Release\BuildLog.htm"
1>Rockman - 3 error(s), 17 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I used to have more errors than this(16 linker errors, conflicting lib's), but I changed a setting from "multi-threaded" debug to "multithreaded debug dll"
Last edited by jibblesmgee on Sun Mar 13, 2011 9:36 pm, edited 3 times in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

what kind of libraries have you put in linker, and what is their order?
I'm guessing you're missing irrlicht lib and bullets soft body lib or it is put in the wrong place.
Working on game: Marrbles (Currently stopped).
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

Post by jibblesmgee »

God... how embarrasing. I forgot Irrlicht.lib... :oops:

One more question: how do you spell "retard"?

(pretty sure it's j-i-b-b-l-e-s-m-g-e-e)
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

Post by jibblesmgee »

Well... that didn't work after all.

I thought that had fixed it, because I was able to create a bullet world, but now I'm all messed up:

1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Player::OnEvent(struct irr::SEvent const &)" (?OnEvent@Player@@UAE_NABUSEvent@irr@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall irrBulletWorld::addRigidBody(class ICollisionShape * const)" (?addRigidBody@irrBulletWorld@@QAEPAVIRigidBody@@QAVICollisionShape@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall IBoxShape::IBoxShape(class irr::scene::ISceneNode * const,float,bool)" (??0IBoxShape@@QAE@QAVISceneNode@scene@irr@@M_N@Z) referenced in function _main
1>..\..\bin\Win32-VisualStudio\test1212.exe : fatal error LNK1120: 3 unresolved externals

I tried to add a collision object and now I'm getting linker errors again... I hate MSVC.

I think I might just try code::blocks, but I'll have to convert my entire project.


Linker files and order:
irrBullet.lib
BulletDynamics.lib
BulletSoftBody.lib
GIMPACTUtils.lib
LinearMath.lib
BulletCollision.lib
Irrlicht.lib

I'll try putting Irrlicht first, but I doubt it will help.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

jibblesmgee wrote: Linker files and order:

Code: Select all

irrBullet.lib 
BulletDynamics.lib 
BulletSoftBody.lib 
GIMPACTUtils.lib 
LinearMath.lib 
BulletCollision.lib 
Wrong order. Bullet needs it this way

Code: Select all

BulletSoftBody.lib 
BulletDynamics.lib
BulletCollision.lib 
LinearMath.lib 
"Whoops..."
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

Post by jibblesmgee »

irrBullet.lib
BulletSoftBody.lib
BulletDynamics.lib
BulletCollision.lib
LinearMath.lib
Irrlicht.lib

Ok, I tried that, now I've got this: (I've always had the 2 warnings, but I figured they probably didn't matter, but maybe they do.)

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Player::OnEvent(struct irr::SEvent const &)" (?OnEvent@Player@@UAE_NABUSEvent@irr@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall irrBulletWorld::addRigidBody(class ICollisionShape * const)" (?addRigidBody@irrBulletWorld@@QAEPAVIRigidBody@@QAVICollisionShape@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall IBoxShape::IBoxShape(class irr::scene::ISceneNode * const,float,bool)" (??0IBoxShape@@QAE@QAVISceneNode@scene@irr@@M_N@Z) referenced in function _main
1>..\..\bin\Win32-VisualStudio\test1212.exe : fatal error LNK1120: 3 unresolved externals
1>Build log was saved at "file://c:\Users\Justin\Desktop\irrlicht-1.7.2\Rockman\Rockman\Release\BuildLog.htm"
1>test1212 - 4 error(s), 19 warning(s)

(17 of the 19 warnings are empty control statements)

am I correct to set the Runtime Lib setting in PropertyPages>ConfigurationProperties>C/C++>CodeGeneration
to Multi-threaded Debug DLL (MDd)?

If I don't I get a bunch of error LNK2005's

I feel like there must be a setting I'm just missing somewhere. it's MSVC2008 if I haven't already stated that.

[edit]
Okay, update: I changed my basic runtime checks to "Both (/RTC1, equiv. to /RTCsu)"

and now I'm left with one unresolved external

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Player::OnEvent(struct irr::SEvent const &)" (?OnEvent@Player@@UAE_NABUSEvent@irr@@@Z)
1>..\..\bin\Win32-VisualStudio\test1212.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Justin\Desktop\irrlicht-1.7.2\Rockman\Rockman\Debug\BuildLog.htm"
1>test1212 - 2 error(s), 18 warning(s)
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Make sure your OnEvent signature in the cpp file matches your header.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

Post by jibblesmgee »

hmmmm... I gave newton another try, but there's just NO documentation for 2.29 in existence (even though it's open source now) and they changed alot (different number of arguments now for the basic stuff) besides that, newton would be a pain to work into my project at this point. I don't have much coded yet, but I'd still have to pretty much rewrite everything (which I'd have done by now after F*ing with this for two days)

I tried to build one of the examples and that code isn't linking right either.
here's the errors for the soft body example, they're very similar to my project's problem.

1>Linking...
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: __thiscall CExampleFramework::CExampleFramework(void)" (??0CExampleFramework@@QAE@XZ) referenced in function "public: __thiscall CSoftbodyExample::CSoftbodyExample(void)" (??0CSoftbodyExample@@QAE@XZ)
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall CExampleFramework::shootSphere(class irr::core::vector3d<float> const &,float)const " (?shootSphere@CExampleFramework@@QBEQAVIRigidBody@@ABV?$vector3d@M@core@irr@@M@Z) referenced in function "public: virtual bool __thiscall CSoftbodyExample::OnEvent(struct irr::SEvent const &)" (?OnEvent@CSoftbodyExample@@UAE_NABUSEvent@irr@@@Z)
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall CExampleFramework::shootCube(class irr::core::vector3d<float> const &,float,class irr::core::string<char,class irr::core::irrAllocator<char> >)const " (?shootCube@CExampleFramework@@QBEQAVIRigidBody@@ABV?$vector3d@M@core@irr@@MV?$string@DV?$irrAllocator@D@core@irr@@@45@@Z) referenced in function "public: virtual bool __thiscall CSoftbodyExample::OnEvent(struct irr::SEvent const &)" (?OnEvent@CSoftbodyExample@@UAE_NABUSEvent@irr@@@Z)
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall CExampleFramework::createGround(void)const " (?createGround@CExampleFramework@@QBEQAVIRigidBody@@XZ) referenced in function "public: virtual void __thiscall CSoftbodyExample::runExample(void)" (?runExample@CSoftbodyExample@@UAEXXZ)
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: class IRigidBody * __thiscall CExampleFramework::addCube(class irr::core::vector3d<float> const &,class irr::core::vector3d<float> const &,float,class irr::core::string<char,class irr::core::irrAllocator<char> >)const " (?addCube@CExampleFramework@@QBEQAVIRigidBody@@ABV?$vector3d@M@core@irr@@0MV?$string@DV?$irrAllocator@D@core@irr@@@45@@Z) referenced in function "public: class ISoftBody * __thiscall CSoftbodyExample::createSoftbodyType(unsigned int,class irr::core::vector3d<float> const &)" (?createSoftbodyType@CSoftbodyExample@@QAEPAVISoftBody@@IABV?$vector3d@M@core@irr@@@Z)
1>softbodyexample.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CExampleFramework::~CExampleFramework(void)" (??1CExampleFramework@@UAE@XZ) referenced in function "public: virtual __thiscall CSoftbodyExample::~CSoftbodyExample(void)" (??1CSoftbodyExample@@UAE@XZ)
1>C:\Users\Justin\Desktop\irrlicht-1.7.2\physics\ib\Debug\ib.exe : fatal error LNK1120: 6 unresolved externals
1>Build log was saved at "file://c:\Users\Justin\Desktop\irrlicht-1.7.2\physics\ib\ib\Debug\BuildLog.htm"
1>ib - 7 error(s), 23 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

All I know is my brain hurts.

I've done a seperate build and install of Bullet, and I tried linking those lib files instead but there's no difference, same errors, same frustration.

Maybe my computer is anti-social.
jibblesmgee
Posts: 42
Joined: Thu Jan 06, 2011 9:12 am

Post by jibblesmgee »

update:

No linker errors: "so far"

but I can't do anything with irrbullet, it crashes at runtime
newleon
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea
Contact:

Re: [solved*ish]irrBullet help, MSVC 2008

Post by newleon »

I have got similar linking errors first, but I found the origin of the problem and here is the solution.

I tried to compile the RaycastTank example. First I made an empty win32 console based application in VS2008. Then I copied the main.cpp, raycasttankexample.cpp, and raycasttankexample.h from "RaycastTank" folder to the newly made folder. Here comes the solution. You must copy and paste exampleframework.cpp and exampleframework.h from "framework" folder too. Then add all the *.h files to the Header Files section and the *.cpp files to the Source Files section.

Do not forget to modify this line
#include "../framework/exampleframework.h"
in raycasttankexample.h file to this one:
#include "exampleframework.h".

Add followings to the Additional Include Libraries, supposing that your irrlicht and irrBullet is installed in C:\irrlicht-1.7.2 and C:\irrBullet-0.1.8 folders respectively.
C:\irrlicht-1.7.2\include
C:\irrBullet-0.1.8\source
C:\irrBullet-0.1.8\source\bheaders
C:\irrBullet-0.1.8\source\bheaders\Bullet

The add followings to the Additional Library Directories.
C:\irrBullet-0.1.8\lib\win32_visualstudio\2008\Debug
C:\irrBullet-0.1.8\lib\win32_visualstudio\2008
C:\irrlicht-1.7.2\lib\Win32-visualstudio

And finally add these libraries in the given order.
irrBullet.lib
BulletDynamics.lib
BulletSoftBody.lib
GIMPACTUtils.lib
LinearMath.lib
BulletCollision.lib
irrlicht.lib

That's it. You are ready to compile this RaycastTank example. I did and it worked with no problem and linking errors.

One last point, when you extract irrBullet, in the C:\irrBullet-0.1.8\lib\win32_visualstudio\2008 folder, there is only "Release" version of the library. To make the deubg version, simply open and compile the C:\irrBullet-0.1.8\source\msvc\2008\irrBullet.sln in debug environment. Just be sure that the Additional Include Directories matches with the folders in your computer.

Good luck.
triguN
Posts: 1
Joined: Sun Apr 07, 2013 6:13 pm

Re: [solved*ish]irrBullet help, MSVC 2008

Post by triguN »

Hi everyone !

Sorry to up a topic 3 month older but I'm facing a problem with irrBullet.

I follow all the steps that explains newleon. But at the compilation I got this output :

Code: Select all

1>HelloWorld.obj : error LNK2019: unresolved external symbol __imp__createDevice referenced in function "public: virtual void __thiscall CHelloWorld::runExample(void)" (?runExample@CHelloWorld@@UAEXXZ)
1>RayCastTankExample.obj : error LNK2001: unresolved external symbol __imp__createDevice
Well as you can see, no one of irrBullet examples works.

Any idea ?

thank you for your time :D !
Post Reply