Board index » cppbuilder » link error:contains invalid OMF record, type 0x21

link error:contains invalid OMF record, type 0x21

I am using BCB3 and try to link some libraries(.lib) which might be
created for VC++. I always got this link error. Is there a way to solve
this?  I am not able to obtain source code to recompile and I am trying
not to learn VC++ on the fly.

Thanks in advance,

Jason Xue(shay)
C. M. A.
972-247-8816 #147
888-629-5455 (Pager)
972-488-2340 (Fax)

 

Re:link error:contains invalid OMF record, type 0x21


Quote
Jason Xue wrote in message <36FA917D.C804D...@cmaeti.com>...
>I am using BCB3 and try to link some libraries(.lib) which might be
>created for VC++. I always got this link error. Is there a way to solve
>this?  I am not able to obtain source code to recompile and I am trying
>not to learn VC++ on the fly.

VC++ static lib files are not compatible with C++Builder. Likewise, you
can't use a BCB lib file with VC++.

Your options are

1- Get the source code for the libs and compile BCB compatible versions
2- Use VC++ to create a DLL wrapper for the libs
3- Use VC++ to create COM wrapper for the libs.
4- Punt on 3rd and 15 from your own 9 yard line.

Harold Howe [TeamB]
http://www.bcbdev.com

Re:link error:contains invalid OMF record, type 0x21


If you have access to the DLL from which the libs come you can use IMPLIB to
create a compatible lib. However, this only works if the DLL exports C
functions. If it exports C++ member functions then you are out of luck.

Nick

Quote
Jason Xue <j...@cmaeti.com> wrote in message

news:36FA917D.C804D252@cmaeti.com...
Quote
> I am using BCB3 and try to link some libraries(.lib) which might be
> created for VC++. I always got this link error. Is there a way to solve
> this?  I am not able to obtain source code to recompile and I am trying
> not to learn VC++ on the fly.

Re:link error:contains invalid OMF record, type 0x21


A question:  I have a large amount of FORTRAN engineering code (I don't want
to have to convert to C++) and the Digital Visual FORTRAN compiler.  This
compiler produces DLL's that are supposed to be compatible with VC++.  I
don't want to have to get VC++.

I would like to use BCB to build a set of frontends for the FORTRAN code.

I assume that I will have the same problem as described in this thread.

Will the COFF2OMF utility make the conversion?

TIA
Bob Miers

Quote
Harold Howe (TeamB) wrote in message <7de538$r...@forums.borland.com>...

>Jason Xue wrote in message <36FA917D.C804D...@cmaeti.com>...
>>I am using BCB3 and try to link some libraries(.lib) which might be
>>created for VC++. I always got this link error. Is there a way to solve
>>this?  I am not able to obtain source code to recompile and I am trying
>>not to learn VC++ on the fly.

>VC++ static lib files are not compatible with C++Builder. Likewise, you
>can't use a BCB lib file with VC++.

>Your options are

>1- Get the source code for the libs and compile BCB compatible versions
>2- Use VC++ to create a DLL wrapper for the libs
>3- Use VC++ to create COM wrapper for the libs.
>4- Punt on 3rd and 15 from your own 9 yard line.

>Harold Howe [TeamB]
>http://www.bcbdev.com

Re:link error:contains invalid OMF record, type 0x21


The one FORTRAN dll I ever worked with probably would not work straight
with COFF2OMF.  FORTRAN dll's often are missing the underscore for
cdecl's.  If COFF2OMF doesn't do it, then just run impdef on the dll to
create a def file.  Open that file and alias the function names.  Then
run implib on the def file to create an OMF compatably import lib file.
It's not all that difficult at all.

Jeff Overcash

"Robert L. Miers, PE" wrote:

Quote

> A question:  I have a large amount of FORTRAN engineering code (I don't want
> to have to convert to C++) and the Digital Visual FORTRAN compiler.  This
> compiler produces DLL's that are supposed to be compatible with VC++.  I
> don't want to have to get VC++.

> I would like to use BCB to build a set of frontends for the FORTRAN code.

> I assume that I will have the same problem as described in this thread.

> Will the COFF2OMF utility make the conversion?

> TIA
> Bob Miers

> Harold Howe (TeamB) wrote in message <7de538$r...@forums.borland.com>...

> >Jason Xue wrote in message <36FA917D.C804D...@cmaeti.com>...
> >>I am using BCB3 and try to link some libraries(.lib) which might be
> >>created for VC++. I always got this link error. Is there a way to solve
> >>this?  I am not able to obtain source code to recompile and I am trying
> >>not to learn VC++ on the fly.

> >VC++ static lib files are not compatible with C++Builder. Likewise, you
> >can't use a BCB lib file with VC++.

> >Your options are

> >1- Get the source code for the libs and compile BCB compatible versions
> >2- Use VC++ to create a DLL wrapper for the libs
> >3- Use VC++ to create COM wrapper for the libs.
> >4- Punt on 3rd and 15 from your own 9 yard line.

> >Harold Howe [TeamB]
> >http://www.bcbdev.com

Other Threads