Code::Blocks Forums

User forums => Help => Topic started by: Aeon on July 29, 2011, 07:39:42 pm

Title: OpenGL & SDL in C::B HELP
Post by: Aeon on July 29, 2011, 07:39:42 pm
Hey guys, I've been learning SDL for quite some time off of the Lazyfoo tutorials.

I wish to now go onto learn OpenGL and program a game using SDL as the environment etc...

I was running through this tutorial:

http://lazyfoo.net/SDL_tutorials/lesson36/index.php

and attempted to compile it, I received one error and the program failed to compile.

The error I received:

undefined reference to `__dyn_tls_init_callback'

Whilst I do realize this is more than likely a problem with the linker, I have no idea what I am doing wrong and wonder if anybody could offer me any advice that would enable me to compile OpenGL with SDL.

These are my "other linker settings": -lmingw32 -lSDLmain -lSDL -lglu32 -lopengl32 which the readme with the source of the tutorial tells me to use.
I do definitely have these present on my system though and I would have a different error if I did not have these.

My "Search Directories" point to MinGW/lib and MinGW/include correctly.

Instead of using the <SDL_opengl> (or whatever the library is called) I included these instead:

#include <gl/gl.h>
#include <gl/glu.h>

which I have read and been told is fine to use for me as I am compiling this program on Windows XP.

My version of CodeBlocks is 8.02 if that is required.


I have been tinkering with the IDE and trying to figure out what is wrong for the past day and I'm really at a brick wall here so any help at all is wonderful.

~ Thanks, Aeon

Title: Re: OpenGL & SDL in C::B HELP
Post by: Ceniza on July 30, 2011, 02:36:41 pm
Plenty of hits searching with Google, including one in these forums.

Please read the rules before you post, as it is required that you search before posting. Even more, your issue is with the compiler/linker/libraries, nothing to do with the Code::Blocks (which is an IDE).
Title: Re: OpenGL & SDL in C::B HELP
Post by: Aeon on July 30, 2011, 04:44:29 pm
I had figured somebody would reply saying something along those lines.

I did search the forums thoroughly seeing as my registration took three attempts over the course of a day to go through, during this day I searched and tweaked searching for the problem.

Yes I do realize it is of some sorts a problem with compiling and not all of the IDE itself, although what I am asking is how do I compile it using the IDE, so it is relevant to this topic.

Any other help would be more than welcome.
Title: Re: OpenGL & SDL in C::B HELP
Post by: Jenna on July 30, 2011, 05:12:08 pm
Yes I do realize it is of some sorts a problem with compiling and not all of the IDE itself, although what I am asking is how do I compile it using the IDE, so it is relevant to this topic.

You would be right, if you would know which settings to make, but you do not know where to set them.

If you don't know the settings, it has nothing to do with C::B, which is an IDE as Ceniza wrote.

If you don't know the difference between IDE and compiler, you should search the web.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_What_Code::Blocks_is_not.3F (http://wiki.codeblocks.org/index.php?title=FAQ#Q:_What_Code::Blocks_is_not.3F)

Please respect our forum rules !!
Title: Re: OpenGL & SDL in C::B HELP
Post by: Aeon on July 30, 2011, 05:49:12 pm
I know the difference between an IDE and a compiler.

Look, I am fairly new to programming, just because I am asking a question which is to do with compilation within the IDE itself am I not going to get an answer?

It's a polite ask for help regardless of where it is posted.

I have searched for the specific problem I have, I realize a lot of people get errors such as undefined reference to glmatrixmode() and what not because they have failed to link the GL libraries.

But I have all of the libraries needed to compile this example linked and I am getting an error of which I have no idea what it's referencing:

undefined reference to `__dyn_tls_init_callback


I'm not going to bother posting again, it's clear I'm going to get frowned upon for posting something which shouldn't be here.

Thanks for your time anyway.
Title: Re: OpenGL & SDL in C::B HELP
Post by: oBFusCATed on July 30, 2011, 07:00:56 pm
http://lmgtfy.com/?q=undefined+reference+to+%60__dyn_tls_init_callback
Good luck...

p.s. Before doing any more programming invest some time in improving your internet-search-skills
Title: Re: OpenGL & SDL in C::B HELP
Post by: Jenna on July 30, 2011, 07:49:02 pm
I know the difference between an IDE and a compiler.

Look, I am fairly new to programming, just because I am asking a question which is to do with compilation within the IDE itself am I not going to get an answer?

It's a polite ask for help regardless of where it is posted.

BUt this forum/website is dedicated to C::B (developping C::B and using C::B), but not problems with special toolkits. libraries, compilers or whatever.

That's stated clearly in the forum rules, you have accepted if you post here (look above the Post and Preview buttons).

So your post shows that you do not care about this rules, even after to reminders (from a C::B-developer and a forum admin).
Maybe you should learn how to behave in forums, before you post again.

Topic locked !