views:

51

answers:

2

I am compiling on a 64 bit architecture with the intel C compiler. The same code built fine on a different 64 bit intel architecture.

Now when I try to build the binaries, I get a message "Skipping incompatible ../../libtime.a" or some such thing, that is indicating the libtime.a that I archived (from some object files I compiled) is not compatible. I googled and it seemed like this was usually the result of a 32->64 bit changeover or something like that, but the intel C compiler doesnt seem to support a -64 or some other memory option at compile time. How do I troubleshoot and fix this error?

+1  A: 

You cannot mix 64-bit and 32-bit compiled code. Config instructions for Linux are here.

Hans Passant
+1 Indeed it seems Derek is trying to link 32bit libraries with 64bit ones.
karlphillip
Turns out the system was IA-64, and somehow someone installed 32bit compilers on it. This did not become obvious to me until I did a "file" on the object files created.
Derek
A: 

You need to determine the target processor of both the library and the new code you are building. This can be done in a few ways but the easiest is:

$ objdump -f ../../libtime.a otherfile.o

For libtime this will probably print out bunches of things, but they should all have the same target processor. Make sure that otherfile.o (which you should substitute one of your object files for) also has the same architecture.

gcc has the -m32 and -m64 flags for switching from the default target to a similar processor with the different register and memory width (commonly x86 and x86_64), which the Intel C compiler may also have.

If this has not been helpful then you should include the commands (with all flags) used to compile everything and also information about the systems that each command was being run on.

nategoose
thanks for the tip, wasnt the issue this time, but i will remember the objdump command
Derek