5

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!

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

3 Comments

How exactly would I add that to my CXXFLAGS? Would it be near where I added that file to my link libraries list?
@Matt: I don't use codeblocks myself, but this section in the docs seems to detail what one needs to do wiki.codeblocks.org/…
@MatthewH did you found out how to add it to the CXXFLAGS? Can you pls tell me how it is done?
1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.