views:

90

answers:

2

Hi, I'm trying to use the SDL_Image library and I've added the .so to the link libraries list for my project (I'm using Code::Blocks, by the way).

After doing this, when I go to compile, I get this error:

Linking console executable: bin/Debug/ttfx
/usr/lib32/libSDL_image-1.2.so: could not read symbols: File in wrong format

What does this mean and how can I get it working?

Edit: I'm using gcc.

Thanks!

+1  A: 

This link and this one suggest that the problem is you're doing a 64-bit compile with a 32-bit library. YMMV

Peter K.
+1  A: 

During the linking step there are incompatibilities since some of your object files were compiled for 32-bit and some for 64-bit. Looking at its path libSDL_image.so was probably compiled for 32-bit.

If you use the GNU compiler add -m32 to your CXXFLAGS to compile your objects for 32-bit, too.

honk
How exactly would I add that to my CXXFLAGS? Would it be near where I added that file to my link libraries list?
Matt H
@Matt: I don't use `codeblocks` myself, but this section in the docs seems to detail what one needs to do http://wiki.codeblocks.org/index.php?title=Developing_32_bit_apps_under_64_bit_Linux_(Ubuntu)#Setting_the_build_options_in_Code::Blocks
honk