Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linker error "contains invalid OMF record"

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.

like image 474
Yaroslav Vozyka Avatar asked Jul 17 '13 08:07

Yaroslav Vozyka


Video Answer


1 Answers

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.

like image 118
Remy Lebeau Avatar answered Nov 15 '22 13:11

Remy Lebeau