链接器错误“包含无效的OMF记录". [英] Linker error "contains invalid OMF record"

查看:156
本文介绍了链接器错误“包含无效的OMF记录".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++ Builder中,我得到

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)

当我使用实用程序coff2omf转换.lib时,新的lib失去了重要的功能.

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

推荐答案

C ++ Builder不能使用其他编译器提供的.lib文件,只能使用它自己的.

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

如果.lib文件是DLL的导入库,请使用C ++ Builder的命令行IMPLIB工具直接从DLL创建新的.lib文件.

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.

如果.lib文件是静态库(包含实际代码),则C ++ Builder的命令行COFF2OMF工具 MAY 可以转换该库,但不能保证.这实际上取决于库实际使用的代码类型.如果无法进行转换,则必须将.lib文件包装到一个DLL中,该DLL是在创建.lib文件的同一编译器中编写的.然后,您可以在C ++ Builder中使用DLL.

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.

这篇关于链接器错误“包含无效的OMF记录".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆