Skipping incompatible error when linking

做~自己de王妃 提交于 2019-12-25 09:46:10

问题


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:


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




回答2:


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.



来源:https://stackoverflow.com/questions/3550571/skipping-incompatible-error-when-linking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!