Linker error “contains invalid OMF record”

吃可爱长大的小学妹 提交于 2019-12-07 13:18:31

问题


In C++ Builder when I compile I get

[ilink32 Error] Error: 'C:\PATH\TO\A\LIB\INCLUDED\IN\THE\PROJECT\ALIBRARY.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

When I convert .lib with utilities coff2omf, new lib looses significant functions.


回答1:


C++Builder cannot use .lib files from other compilers, only its own.

If the .lib file is an import lib for a DLL, use C++Builder's command-line IMPLIB tool to create a new .lib file from the DLL directly.

If the .lib file is a static library (containing actual code), C++Builder's command-line COFF2OMF tool MAY be able to convert the library, but it is not guaranteed. It really depends on what kind of code the library is actually using. If the conversion is not possible, you will have to wrap the .lib file into a DLL that is written in the same compiler that created the .lib file. Then you can use the DLL in C++Builder.



来源:https://stackoverflow.com/questions/17694860/linker-error-contains-invalid-omf-record

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