SDL_draw: " [Linker error] undefined reference to `Draw_FillCircle' "

Hi all. Recently, I stumbled across some code in which to create a
little physics test with circles (using SDL_draw. here’s the code
http://pasteall.org/3008/cpp). When I first ran the code, Dev-C++ gave
me the error that it was not able to find ‘SDL\SDL_draw.h’. So, I
went to http://sdl-draw.sourceforge.net/ and downloaded all of the
files. I took SDL_draw.h out of the include folder and put it into
the include folder in my SDL directory. So, I set up the program,
added the linkers, ran the program again, and it imported SDL_draw.h.
Good. The only problem was that it gave me these errors:

[Linker error] undefined reference to Draw_FillCircle' [Linker error] undefined reference toDraw_Line’

I knew that it was going to give me those errors, but I didn’t know
what to do. I also knew that all of the SDL_draw functions where in
separate files in the ‘src’ folder. So my question is, how do I ‘link’
(if that’s the correct term in this case) those SDL_draw functions in
the src folder to SDL itself? Any help will be much appreciated.
Thanks!

This looks like it just couldn’t find your library file (or you didn’t
tell the linker about it). Assuming you’re on Windows from the
Dev-C++ reference, you would copy a file like libsdl_draw.a into your
compiler’s “lib” folder. This file comes from building the library
from the source that you get on Sourceforge. There seems to be a
Dev-C++ project file in there, so it might just work right away for
you. Make sure you add a linker option like -lsdl_draw or the
equivalent.

Jonny DOn Thu, Aug 20, 2009 at 4:53 PM, Luke Endres wrote:

Hi all. Recently, I stumbled across some code in which to create a
little physics test with circles (using SDL_draw. here’s the code
http://pasteall.org/3008/cpp). When I first ran the code, Dev-C++ gave
me the error that it was not able to find ‘SDL\SDL_draw.h’. ?So, I
went to http://sdl-draw.sourceforge.net/ and downloaded all of the
files. I took ?SDL_draw.h out of the include folder and put it into
the include folder in my SDL directory. So, I set up the program,
added the linkers, ran the program again, and it imported SDL_draw.h.
Good. The only problem was that it gave me these errors:

?[Linker error] undefined reference to Draw_FillCircle' ?[Linker error] undefined reference toDraw_Line’

I knew that it was going to give me those errors, but I didn’t know
what to do. I also knew that all of the SDL_draw functions where in
separate files in the ‘src’ folder. So my question is, how do I ‘link’
(if that’s the correct term in this case) those SDL_draw functions in
the src folder to SDL itself? Any help will be much appreciated.
Thanks!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org