PDA

View Full Version : video tutorials rock crab pong game for ubuntu



Jonas Thomas
03-06-2011, 11:44 AM
Hi,
First time poster here.
I've been trying to setup a code::blocks project file for running the video tutorials roc crab pong tutorial running ubuntu 10.04 linux.
The tutorial is found here:
http://www.videotutorialsrock.com/opengl_tutorial/crab_pong/home.php http://www.videotutorialsrock.com/opengl_tutorial/crab_pong/home.php

In my build option=>GCC GNU COMPILER=>Other options I've included: -lglut -lGLU -lGL

I'm compiling ok, but I run into these linker errors:


obj/Debug/gamedrawer.o||In function `(anonymous namespace)::loadTexture(Image*)':|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|80|undefined reference to `glGenTextures'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|81|undefined reference to `glBindTexture'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|89|undefined reference to `glTexImage2D'|
obj/Debug/gamedrawer.o||In function `GameDrawer::setupBarriers()':|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|163|undefined reference to `glGenLists'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|164|undefined reference to `glNewList'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|167|undefined reference to `glEnable'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|168|undefined reference to `glBindTexture'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|169|undefined reference to `glTexParameteri'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|170|undefined reference to `glTexParameteri'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|173|undefined reference to `glMaterialfv'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|175|undefined reference to `glNormal3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|176|undefined reference to `glBegin'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|177|undefined reference to `glTexCoord2f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|178|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|181|undefined reference to `glTexCoord2f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|184|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|186|undefined reference to `glEnd'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|190|undefined reference to `glMaterialfv'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|192|undefined reference to `glDisable'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|193|undefined reference to `glColor3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|194|undefined reference to `glNormal3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|195|undefined reference to `glBegin'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|196|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|199|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|201|undefined reference to `glEnd'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|204|undefined reference to `glBegin'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|207|undefined reference to `glNormal3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|209|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|212|undefined reference to `glVertex3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|214|undefined reference to `glEnd'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|215|undefined reference to `glEndList'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|220|undefined reference to `glGenLists'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|221|undefined reference to `glNewList'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|222|undefined reference to `glDisable'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|226|undefined reference to `glMaterialfv'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|227|undefined reference to `glMaterialf'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|231|undefined reference to `glPushMatrix'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|232|undefined reference to `glTranslatef'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|233|undefined reference to `glCallList'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|234|undefined reference to `glPopMatrix'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|237|undefined reference to `glEnable'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|242|undefined reference to `glMaterialfv'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|243|undefined reference to `glMaterialfv'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|245|undefined reference to `glEndList'|
obj/Debug/gamedrawer.o||In function `GameDrawer::setupPole()':|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|249|undefined reference to `glGenLists'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|250|undefined reference to `glNewList'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|251|undefined reference to `glDisable'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|252|undefined reference to `glColor3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|255|undefined reference to `glNormal3f'|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|256|undefined reference to `glBegin'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|


I guess I'm looking for the fish and how to catch it.
I'm sure I need a -l something or other....

If I'm getting something like this:
obj/Debug/gamedrawer.o||In function `(anonymous namespace)::loadTexture(Image*)':|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|80|undefined reference to `glGenTextures'|

What's the -l, I need to include, and other than asking here is there a general lookup I can go to figure out what library I need, without having to stop and ask for directions.

Thanks,
JT

NeuroFuzzy
03-06-2011, 12:43 PM
-lOpenGL32 -lglu32
?

Jonas Thomas
03-06-2011, 12:54 PM
Thanks for the reply...
The issue that I was having was that I didn't set the linker setting correctly in code::blocks...
Big duh...
Although now I it can't find

obj/Debug/gamedrawer.o||In function `GameDrawer::drawBalls(bool)':|
/home/jonas/crab_game/crab_game/gamedrawer.cpp|533|undefined reference to `glutSolidSphere'|
obj/Debug/main.o||In function `drawScene()':|
/home/jonas/crab_game/crab_game/main.cpp|154|undefined reference to `glutSwapBuffers'|
obj/Debug/main.o||In function `update(int)':|
/home/jonas/crab_game/crab_game/main.cpp|165|undefined reference to `glutPostRedisplay'|
/home/jonas/crab_game/crab_game/main.cpp|166|undefined reference to `glutTimerFunc'|
obj/Debug/main.o||In function `main':|
/home/jonas/crab_game/crab_game/main.cpp|172|undefined reference to `glutInit'|
/home/jonas/crab_game/crab_game/main.cpp|173|undefined reference to `glutInitDisplayMode'|
/home/jonas/crab_game/crab_game/main.cpp|174|undefined reference to `glutInitWindowSize'|
/home/jonas/crab_game/crab_game/main.cpp|176|undefined reference to `glutCreateWindow'|
/home/jonas/crab_game/crab_game/main.cpp|181|undefined reference to `glutDisplayFunc'|
/home/jonas/crab_game/crab_game/main.cpp|182|undefined reference to `glutKeyboardFunc'|
/home/jonas/crab_game/crab_game/main.cpp|183|undefined reference to `glutSpecialFunc'|
/home/jonas/crab_game/crab_game/main.cpp|184|undefined reference to `glutSpecialUpFunc'|
/home/jonas/crab_game/crab_game/main.cpp|185|undefined reference to `glutReshapeFunc'|
/home/jonas/crab_game/crab_game/main.cpp|186|undefined reference to `glutTimerFunc'|
/home/jonas/crab_game/crab_game/main.cpp|188|undefined reference to `glutMainLoop'|
||=== Build finished: 15 errors, 0 warnings ===|

But... now I think I know where my issues where... hope to post the solution shortly...

Don't know what I was thinking...
Just needed
-lGL -lGLU -lglut
in the linker settings and one minor tweek to code and works fine in Ubuntu...

Anyway... If anyone wants to play with this in ubuntu.. I did a post on my blog..
http://www.metalshaperman.com/?p=631 http://www.metalshaperman.com/?p=631