Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Linker Error SDL Image - could not read symbols

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!

like image 975
Matthew H Avatar asked Mar 27 '10 01:03

Matthew H


1 Answers

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.

like image 136
Benjamin Bannier Avatar answered Sep 30 '22 00:09

Benjamin Bannier