是静态的C函数库和与其他兼容的一编译器生成的? [英] Are static c libraries created with one compiler compatible with another?
问题描述
在我来说,我有code的Sourcery GCC目标的ARM Cortex-M4建一个图书馆。我想那么该库链接到一个项目正在编译与IAR编译器。
In my case I have a library built with code sourcery gcc targeting arm cortex-m4. I am trying to then link that library into a project being compiled with IAR compiler.
是否有可能做到这一点还是图书馆已与新的工具来重建?哪些因素影响呢?
Is it possible to do this or does the library have to be rebuilt with the new tools? What factors affect this?
推荐答案
静态库是多个目标文件它们总是具体的编译器捆绑。所以,如果你尝试链接 GCC
基于LIB与 IAR
编译器,你将在编译时,由于不匹配出现错误之间的目标文件格式进行联系。
Static library is bundle of several object files which are always compiler specific. So if you try to link a gcc
based lib with IAR
compiler, you will get error at compile time due to mismatch between object file formats to be linked.
您需要使用IAR重新构建库。
You need to rebuild your library using IAR.
这篇关于是静态的C函数库和与其他兼容的一编译器生成的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!