/Usr/Bin/Ld: Skipping Incompatible Foo.So When Searching for Foo

GCC -m32 flag: /usr/bin/ld: skipping incompatible

It's not possible to link 32 bit applications against 64 bit libraries and vice versa. The problem is that pointers and types in general can't be passed between them. Normally the workaround is to spawn a child process of the other size and use IPC to communicate with that process.

Think about it this way: If I have a C trivial function:

extern void foo(void*); 

If it's in a 64bit library and I try and call it from a 32bit library where does the other half of the pointer come from?

Conversely if it's in a 32bit library and I call it from a 64bit application what happens to the other half of the pointer which I would have to lose to call it?

Skipping Incompatible Libraries at compile

That message isn't actually an error - it's just a warning that the file in question isn't of the right architecture (e.g. 32-bit vs 64-bit, wrong CPU architecture). The linker will keep looking for a library of the right type.

Of course, if you're also getting an error along the lines of can't find lPI-Http then you have a problem :-)

It's hard to suggest what the exact remedy will be without knowing the details of your build system and makefiles, but here are a couple of shots in the dark:

  1. Just to check: usually you would add
    flags to CFLAGS rather than
    CTAGS - are you sure this is
    correct? (What you have may be correct - this will depend on your build system!)
  2. Often the flag needs to be passed to the linker too - so you may also need to modify LDFLAGS

If that doesn't help - can you post the full error output, plus the actual command (e.g. gcc foo.c -m32 -Dxxx etc) that was being executed?

Skipping incompatible on Blue Gene machine

Your problem is not in finding Kyotocabinet. Your problem is that the library you are pointing at: /some_path/lib/libkyotocabinet.so is built for incompatible architecture (most linkely ppc32).

Do file -L /some_path/lib/libkyotocabinet.so and see what it says. You must rebuilt it for the same architecture as what gcc produces by default.

Update: file says ELF 64-bit MSB shared object, 64-bit PowerPC. But does that match what your g++ outputs by default? What is the output from:

echo "int foo() { return 0; }" | g++ -xc++ - -c -o foo.o &&
file foo.o

I bet above will print 32-bit PowerPC, in which case you need to add -m64 to your command line.

Update 2:

Any idea for this problem??

You should not be so helpless. You understand that the problem is mis-matched libraries, so go and fix it.

  1. Decide whether you want the final binary to run in 32-bit or 64-bit mode
  2. Obtain or rebuild all the libraries your need in the bitness you desire
  3. Build the final binary
  4. Profit!


Related Topics



Leave a reply



Submit