Error while compiling BasicDemo (installation folder demo works)

Post Reply
Martinv555
Posts: 1
Joined: Wed Nov 28, 2018 10:50 am

Error while compiling BasicDemo (installation folder demo works)

Post by Martinv555 » Wed Nov 28, 2018 10:59 am

I've been having trouble making my PC to locate libraries while using Netbeans QtCreator and console commands. So i've made a lot of changes to the settings and setup. Not sure if this has caused the current malfunction but, when I use the console command:

Code: Select all

g++ *.cpp -lSDL -lGL -lGLU -lSDL_image -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -I/usr/include/bullet/ -I/.../bullet-2.82-r2704/Demos/OpenGL/
I get the following response:

Code: Select all

/tmp/ccB91Pam.o: In function `BasicDemo::initPhysics()':
BasicDemo.cpp:(.text+0x303): undefined reference to `DemoApplication::setCameraDistance(float)'
/tmp/ccB91Pam.o: In function `__static_initialization_and_destruction_0(int, int)':
BasicDemo.cpp:(.text+0xf2a): undefined reference to `GLDebugDrawer::GLDebugDrawer()'
BasicDemo.cpp:(.text+0xf39): undefined reference to `GLDebugDrawer::~GLDebugDrawer()'
/tmp/ccB91Pam.o: In function `GlutDemoApplication::~GlutDemoApplication()':
BasicDemo.cpp:(.text._ZN19GlutDemoApplicationD2Ev[_ZN19GlutDemoApplicationD5Ev]+0xd): undefined reference to `vtable for GlutDemoApplication'
BasicDemo.cpp:(.text._ZN19GlutDemoApplicationD2Ev[_ZN19GlutDemoApplicationD5Ev]+0x20): undefined reference to `DemoApplication::~DemoApplication()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x10): undefined reference to `DemoApplication::removePickingConstraint()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x18): undefined reference to `DemoApplication::pickObject(btVector3 const&, btCollisionObject const*)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x40): undefined reference to `DemoApplication::myinit()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x48): undefined reference to `DemoApplication::updateCamera()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x60): undefined reference to `DemoApplication::setShootBoxShape()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x68): undefined reference to `DemoApplication::shootBox(btVector3 const&)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x70): undefined reference to `DemoApplication::keyboardCallback(unsigned char, int, int)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x80): undefined reference to `GlutDemoApplication::specialKeyboard(int, int, int)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x90): undefined reference to `DemoApplication::reshape(int, int)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0x98): undefined reference to `DemoApplication::mouseFunc(int, int, int, int)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0xa0): undefined reference to `DemoApplication::mouseMotionFunc(int, int)'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0xb0): undefined reference to `DemoApplication::renderme()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0xb8): undefined reference to `GlutDemoApplication::swapBuffers()'
/tmp/ccB91Pam.o:(.rodata._ZTV9BasicDemo[_ZTV9BasicDemo]+0xc0): undefined reference to `GlutDemoApplication::updateModifierKeys()'
/tmp/ccB91Pam.o:(.rodata._ZTI9BasicDemo[_ZTI9BasicDemo]+0x10): undefined reference to `typeinfo for GlutDemoApplication'
/tmp/ccyLQzWf.o: In function `main':
main.cpp:(.text+0x70): undefined reference to `glutmain(int, char**, int, int, char const*, DemoApplication*)'
/tmp/ccyLQzWf.o: In function `GlutDemoApplication::GlutDemoApplication()':
main.cpp:(.text._ZN19GlutDemoApplicationC2Ev[_ZN19GlutDemoApplicationC5Ev]+0x14): undefined reference to `DemoApplication::DemoApplication()'
main.cpp:(.text._ZN19GlutDemoApplicationC2Ev[_ZN19GlutDemoApplicationC5Ev]+0x19): undefined reference to `vtable for GlutDemoApplication'
collect2: error: ld returned 1 exit status
What could be the cause of this? I can't see why it would return undefined references. Up until now it couldn't find any of the bullet libraries (Even though Netbeans could autofill them), so I had to put the paths manually in the IDEs and console command. Is this a possible cause?

Post Reply