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:
- Just to check: usually you would add
flags toCFLAGS
rather thanCTAGS
- are you sure this is
correct? (What you have may be correct - this will depend on your build system!) - 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.
- Decide whether you want the final binary to run in 32-bit or 64-bit mode
- Obtain or rebuild all the libraries your need in the bitness you desire
- Build the final binary
- Profit!
Related Topics
Delete All Files Except the Newest 3 in Bash Script
X86 Linux Assembler Get Program Parameters from _Start
How to Download the Torvalds Linux Kernel Master, (Re)Compile It, and Boot It with Qemu
How to Toggle Cr/Lf in Gnu Screen
Cuda Performance Penalty When Running in Windows
How to Remove Only the First Occurrence of a Line in a File Using Sed
How to View and Edit the Ephemeral Port Range on Linux
How to Strip Path While Archiving with Tar
Process Command Line in Linux 64 Bit
Paste Two Text Lists (One List a File) into One List Separated by Semicolon
Sort Logs by Date Field in Bash
Find Out If File Has Been Modified Within the Last 2 Minutes
Add Blank Line After Every Result in Grep
Building Arm Gnu Cross Compiler
Nginx: [Emerg] Unknown Directive " " in /Etc/Nginx/Sites-Enabled/Example.Com:3
Tcp: Server Sends [Rst, Ack] Immediately After Receiving [Syn] from Client