SDL_image with Eclipse on Mac

Hi,

I just started working with SDL and until now everything worked fine.
But I got a problem now.

I tried adding SDL_image to my Project in Eclipse and when I try to run it I get the following Error:

Code:
Undefined symbols:
"_IMG_Load", referenced from:
load_image(std::basic_string<char, std::char_traits, std::allocator >)in main.o
ld: symbol(s) not found

I set up my Eclipse for SDL like this:
http://www.two-giants.com/archives/253
I guess it doesn’t help you that much cause it’s german. :smiley:

So I thought I just need to download SDL_image, copy it to Library/Frameworks and include it in my Eclipse-Project.

In Eclipse I right-clicked on my project -> Properties -> C/C++ Build -> Settings and added the Headers-Folder of SDL_image to the includes of GCC C++ Compiler.

Eclipse finds the Header-File and everything seems to be working, so Eclipse pretty much knows that their is a function called IMG_Load in SDL_image, but when I try to run it I get the error.

Did I miss adding SDL_image somewhere or what did I do wrong?
The thing that’s confusing me is, that Eclipse knows there is the function IMG_Load but when I try to run it suddenly the Compiler can’t find it.

The compiler is finding it for sure. The linker (ld) is not. I’m not
familiar with Eclipse, however. You need to link to SDL_image.a somehow.
It should be a quick Google away. Typically you add it to a linker
libraries list as “SDL_image”.

Jonny DOn Fri, Sep 24, 2010 at 6:23 PM, Creativ wrote:

Hi,

I just started working with SDL and until now everything worked fine.
But I got a problem now.

I tried adding SDL_image to my Project in Eclipse and when I try to run it
I get the following Error:

Code:

Undefined symbols:
"_IMG_Load", referenced from:
load_image(std::basic_string, std::allocator >)in main.o
ld: symbol(s) not found

I set up my Eclipse for SDL like this:
http://www.two-giants.com/archives/253
I guess it doesn’t help you that much cause it’s german. [image: Very
Happy]

So I thought I just need to download SDL_image, copy it to
Library/Frameworks and include it in my Eclipse-Project.

In Eclipse I right-clicked on my project -> Properties -> C/C++ Build ->
Settings and added the Headers-Folder of SDL_image to the includes of GCC
C++ Compiler.

Eclipse finds the Header-File and everything seems to be working, so
Eclipse pretty much knows that their is a function called IMG_Load in
SDL_image, but when I try to run it I get the error.

Did I miss adding SDL_image somewhere or what did I do wrong?
The thing that’s confusing me is, that Eclipse knows there is the function
IMG_Load but when I try to run it suddenly the Compiler can’t find it.


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

you could try to tell the linker to explicitly link with sdl_image by
passing -lSDL_image to the list of linker flags (and/or to the cflags)
VittorioOn Sun, Sep 26, 2010 at 6:06 PM, Jonathan Dearborn wrote:

The compiler is finding it for sure. The linker (ld) is not. I’m not
familiar with Eclipse, however. You need to link to SDL_image.a somehow.
It should be a quick Google away. Typically you add it to a linker
libraries list as “SDL_image”.

Jonny D

On Fri, Sep 24, 2010 at 6:23 PM, Creativ wrote:

Hi,

I just started working with SDL and until now everything worked fine.
But I got a problem now.

I tried adding SDL_image to my Project in Eclipse and when I try to run it
I get the following Error:

Code:

Undefined symbols:
"_IMG_Load", referenced from:
load_image(std::basic_string, std::allocator >)in main.o
ld: symbol(s) not found

I set up my Eclipse for SDL like this:
http://www.two-giants.com/archives/253
I guess it doesn’t help you that much cause it’s german. [image: Very
Happy]

So I thought I just need to download SDL_image, copy it to
Library/Frameworks and include it in my Eclipse-Project.

In Eclipse I right-clicked on my project -> Properties -> C/C++ Build ->
Settings and added the Headers-Folder of SDL_image to the includes of GCC
C++ Compiler.

Eclipse finds the Header-File and everything seems to be working, so
Eclipse pretty much knows that their is a function called IMG_Load in
SDL_image, but when I try to run it I get the error.

Did I miss adding SDL_image somewhere or what did I do wrong?
The thing that’s confusing me is, that Eclipse knows there is the function
IMG_Load but when I try to run it suddenly the Compiler can’t find it.


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


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