Board index » cppbuilder » Pascal in BCB5 gives [Linker Error] 'module' contains invalid OMF record, type 0x2f

Pascal in BCB5 gives [Linker Error] 'module' contains invalid OMF record, type 0x2f

Hi

I've got BCB5 and got problems with pascal-files.

In BCB3 it's working all right but after testing it in Delphi5 and it works there, I've got serious problem when linking the projekts with the pascal-files in BCB5.

The file compiles. A HPP-file is created, but the linker says the HPP-file is corrupt with the following message.

[Linker Error] 'C:\PROJECTS\QPRO\UTVECKLING\BCB5TEST\SUBJECT.HPP' contains invalid OMF record, type 0x2f

Someone who knows about these kind of faults?
Someone who knows about the error code 0x2f?
Someone who knows about restrictions in BCB5 how to use pascal?

I've seen special solutions in Borlands own vcl-code that seems very special.
They use the {$EXTERNALSYM 'declarationname'} and make new declaration in a special *.h file instead or redeclare it with
(*$HPPEMIT ' c++ declaration'} in the pascal-file.

Component-builders would maybe have run into these kind of problem too.

Please help me

Magnus Fredriksson

 

Re:Pascal in BCB5 gives [Linker Error] 'module' contains invalid OMF record, type 0x2f


Quote
"Magnus Fredriksson" <magnus.fredriks...@guide.se> wrote in message

news:3c14c6da$1_2@dnews...
Quote

[...]
> The file compiles. A HPP-file is created, but the linker says the HPP-file

is corrupt with the following message.
Quote

> [Linker Error] 'C:\PROJECTS\QPRO\UTVECKLING\BCB5TEST\SUBJECT.HPP' contains

invalid OMF record, type 0x2f

Quote

It seems that you are trying to link an HPP-file, and this is not a good
idea. HPP-files are source files, they
are compiled along with CPP-files to produce OBJect-files. they are not
something to link with.
I think the problem is in your makefile...

Ciao

Re:Pascal in BCB5 gives [Linker Error] 'module' contains invalid OMF record, type 0x2f


Hi Roberto

You where right

in the projekt source file there where link commands which must have been generated somehow.
It worke when I took the away

Thanks

Magnus Fredriksson

Quote
"Roberto Mariottini" <rmariott...@lycosmail.com> wrote:

>"Magnus Fredriksson" <magnus.fredriks...@guide.se> wrote in message
>news:3c14c6da$1_2@dnews...

>[...]
>> The file compiles. A HPP-file is created, but the linker says the HPP-file
>is corrupt with the following message.

>> [Linker Error] 'C:\PROJECTS\QPRO\UTVECKLING\BCB5TEST\SUBJECT.HPP' contains
>invalid OMF record, type 0x2f

>It seems that you are trying to link an HPP-file, and this is not a good
>idea. HPP-files are source files, they
>are compiled along with CPP-files to produce OBJect-files. they are not
>something to link with.
>I think the problem is in your makefile...

>Ciao

Re:Pascal in BCB5 gives [Linker Error] 'module' contains invalid OMF record, type 0x2f


Quote
"Roberto Mariottini" <rmariott...@lycosmail.com> wrote:

>"Magnus Fredriksson" <magnus.fredriks...@guide.se> wrote in message
>news:3c14c6da$1_2@dnews...

>[...]
>> The file compiles. A HPP-file is created, but the linker says the HPP-file
>is corrupt with the following message.

>> [Linker Error] 'C:\PROJECTS\QPRO\UTVECKLING\BCB5TEST\SUBJECT.HPP' contains
>invalid OMF record, type 0x2f

>It seems that you are trying to link an HPP-file, and this is not a good
>idea. HPP-files are source files, they
>are compiled along with CPP-files to produce OBJect-files. they are not
>something to link with.
>I think the problem is in your makefile...

>Ciao

Hi

I have not added the HPP-file myself. It's generated the second I try to compile my projekt (I've taken away every generated file .hpp, .obj, .dcu and recompiled and got the same result).

The .HPP file is instead of the .h file for a .cpp unit.
Is not that file to be used for linking to other units/modules?
The makefile that I generate seems right but I don't know if there are any compiler flags that need to be changed to get this all right.

Magnus Fredriksson

Other Threads