0

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?

Derek
  • 11,715
  • 32
  • 127
  • 228
  • possible duplicate of [Skipping Incompatible Libraries at compile](http://stackoverflow.com/questions/3119714/skipping-incompatible-libraries-at-compile) – user2284570 Nov 30 '13 at 21:47

2 Answers2

1

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

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • +1 Indeed it seems Derek is trying to link 32bit libraries with 64bit ones. – karlphillip Aug 23 '10 at 19:46
  • 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 Aug 23 '10 at 21:35
1

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
  • 12,054
  • 27
  • 42