Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rexona on November 17, 2005, 08:23:54 am

Title: compilation error
Post by: rexona on November 17, 2005, 08:23:54 am
hi guys...

when i try to compile my code i got this kind of error

Switching to target: default
Linking console executable: lab01.exe
.objs/lab01.o(.text+0x2b7): In function `SimplePolygon::draw()':
: undefined reference to `glDisable'
.objs/lab01.o(.text+0x2c7): In function `SimplePolygon::draw()':
: undefined reference to `glDisable'
.objs/lab01.o(.text+0x2d4): In function `SimplePolygon::draw()':
: undefined reference to `glBegin'
.objs/lab01.o(.text+0x2f1): In function `SimplePolygon::draw()':
: undefined reference to `glColor3f'
.objs/lab01.o(.text+0x30e): In function `SimplePolygon::draw()':
: undefined reference to `glVertex3f'
.objs/lab01.o(.text+0x32b): In function `SimplePolygon::draw()':
: undefined reference to `glVertex3f'

what did i miss there? what can i do? what should i do?

i'm running on slackware current

thx guys
Title: Re: compilation error
Post by: mandrav on November 17, 2005, 08:35:06 am
Add GL in link libraries...
Title: Re: compilation error
Post by: rexona on November 17, 2005, 11:26:30 am
sorry? link lib? where can i find it?

i'm sorry i'm newbie on both linux and codeblocks

thx
Title: Re: compilation error
Post by: mandrav on November 17, 2005, 12:12:50 pm
Go to "Project->Build options->Linker->Link libraries", click "Add", type GL and press "OK".
Title: Re: compilation error
Post by: rexona on November 17, 2005, 03:01:48 pm
i've tried that so many times, but still cannot work  :(

what should i include?
Title: Re: compilation error
Post by: MortenMacFly on November 17, 2005, 07:21:02 pm
i've tried that so many times, but still cannot work  :(
You might want to try the OpenGL template provided with Code::Blocks. This normally works and you can copy/paste the settings.
You might also install the OpenGL DevPack (use the DevPack plugin for download) to make sure you have the right libraries and other "stuff" installed.

Morten.
Title: Re: compilation error
Post by: rexona on November 18, 2005, 12:27:46 am
Quote
You might want to try the OpenGL template provided with Code::Blocks. This normally works and you can copy/paste the settings.

can you tell me please how to do that?

what do i need in my slackware to do opengl project?

Title: Re: compilation error
Post by: MortenMacFly on November 18, 2005, 07:58:42 am
can you tell me please how to do that?
Open Code::Blocks, select "File" -> "New Project...". Scroll down in the templates and seelect the "OpenGL Application". Click on "Create". Right-Click on the project and veryfiy the settings made in the project options and build options. Especially make sure the path's is setup (added) in a way the compiler can find the OpenGL libs and headers.

Morten.
Title: Re: compilation error
Post by: rexona on November 20, 2005, 10:20:31 am
i couldn't find the "OpenGL Application" template :( so how?

sorry and thx
Title: Re: compilation error
Post by: MortenMacFly on November 20, 2005, 11:23:04 am
i couldn't find the "OpenGL Application" template :( so how?
I didn't notice that you are now on slackware. Your first post was about an ".exe " so I thought this in a Win32 application. The OpenGL template is only available for Windows. Sorry. But: I guess it should be easy possible to adopt the template for Linux. You might want to download the source code of Code::Blocks, extract the OpenGL template (it's under templates\win32) and give it a try.

I don't have access to a Linux box otherwise I would provide you with it.

Morten.
Title: Re: compilation error
Post by: MortenMacFly on November 20, 2005, 11:26:30 am
The OpenGL template is only available for Windows.
...wait a minute: There should also be the GLFW template available und Linux. This is based on OpenGL (as far as I know) so it might be a good starting point as well. You should only have to remove the "glfw" library...?!

Please, somebody correct me, if I'm wrong.

Morten.