Board index » delphi » Error 51: Invalid PUBLIC segment ... (BP7.0)

Error 51: Invalid PUBLIC segment ... (BP7.0)

Hello,

I have a problem, I'm trying to link some OBJ files written in C with
pascal directive to Pascal and I'm getting this error while
compiling. This happen only to two OBJ's from 18 succesfuly linked
OBJ's. Can someone help me?

 Andy

PS: Please post also to my address

--------------------------------------------------------
 Ondrej 'Andy' Brablc  < http://manes.vse.cz/~xbrao01 >

 

Re:Error 51: Invalid PUBLIC segment ... (BP7.0)


Quote
Ondrej 'Andy' Brablc wrote:
> Hello,

> I have a problem, I'm trying to link some OBJ files written in C with
> pascal directive to Pascal and I'm getting this error while
> compiling. This happen only to two OBJ's from 18 succesfuly linked
> OBJ's. Can someone help me?

In .OBJ files, each PUBLIC (procedural link to an external location) belongs
in a named segment.  The *only* segment a PUBLIC is allowed in by TP/BP is
CODE.  It's likely that those .OBJ files have PUBLICs declared in segments
other than CODE (such as DATA, or one that's been user-defined).

From the TASM manual that comes with BP7:

"You can define symbols as PUBLIC only in the CODE segment.  Borland Pascal
does not allow any PUBLIC definitions of symbols in a data segment."

You'll also need to make sure that the .OBJ code you're calling makes use of
Pascal calling syntax, otherwise you'll have a big problem when you try to
execute the program!

Quote
>  Andy

> PS: Please post also to my address

Done!

Quote
> --------------------------------------------------------
>  Ondrej 'Andy' Brablc  < http://manes.vse.cz/~xbrao01 >

--
Scott Earnest                      | _,-""-_,-""-_,-""-_,-""-_,-""-_,-" |
set...@ix.netcom.com (primary)     | We now return you to our regularly |
siny...@{*word*104}space.org (alternate) | scheduled chaos and mayhem. . . .  |

Other Threads