Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

doesn't anybody know?

0 views
Skip to first unread message

Michael Frayn

unread,
Aug 17, 1999, 3:00:00 AM8/17/99
to
I think I've pulled off the first stumper of all the newsgroups :( As
far as I can tell, there seems to be no way to compile a .OBJ file in BC++
3.1 so that Turbo Pascal 7.0 can use it. There must be a way, right?

Mike
e-mail: mfr...@home.com

Assassin

unread,
Aug 17, 1999, 3:00:00 AM8/17/99
to
does TP7 reject an .OBJ file that is just barebones c++ code (the minimal
needed to make a running program)?


Michael Frayn <mfr...@home.com> wrote:
: I think I've pulled off the first stumper of all the newsgroups :( As

Norm Dresner

unread,
Aug 17, 1999, 3:00:00 AM8/17/99
to
Are you trying to write C or C++?

What library functions are you calling?

Are you linking in TP7 with the C-libraries too?

Norm

Michael Frayn <mfr...@home.com> wrote in article
<Vriu3.16262$C6.1...@news2.rdc1.on.home.com>...

dot r dot wood@worldnet.att.net Charles Wood

unread,
Aug 17, 1999, 3:00:00 AM8/17/99
to
Well, If I recall correctly, you can't use any global variables in the .obj
file. Use extern in the 'c' code to reference the variables created in the
Pascal Program.
I don't know why, but this worked for me.

I have personally done this, so if you give me a tiny example file of the
'C' and 'Pas' and email it, I will show you how in a few days. (After I
do it)

like

unit hello;


procedure somefunction:byte;

{$L something.obj}

imp;

begin
somfunction;
end;


--
Charles Wood
REMOVEME...@worldnet.att.net


Michael Frayn wrote in message ...

Michael Frayn

unread,
Aug 18, 1999, 3:00:00 AM8/18/99
to
All I did was write a simple function in c:

int square ( int x )
{
return x * x;
}

had a header file which just contained a forward declaration of the
function, a cpp file which had the function itself, compiled it into a .OBJ
file, tried to include into TP7.0 with {$L square.obj} and it said:

"invalid object file" (maybe: "invalid object file record")

Any ideas?

Michael Frayn
e-mail: mfr...@home.com
Norm Dresner wrote in message <01bee8e9$cbaba3c0$05ed4e0c@nilrem>...


>Are you trying to write C or C++?
>
>What library functions are you calling?
>
>Are you linking in TP7 with the C-libraries too?
>
> Norm
>
>Michael Frayn <mfr...@home.com> wrote in article

><Vriu3.16262$C6.1...@news2.rdc1.on.home.com>...


>> I think I've pulled off the first stumper of all the newsgroups

>As

Matthew van de Werken

unread,
Aug 18, 1999, 3:00:00 AM8/18/99
to
Try:

extern "C" {


int square ( int x ){

return (x*x);
}
}

Hope this helps,
Cheers,
MvdW

Robert Zanatta

unread,
Aug 19, 1999, 3:00:00 AM8/19/99
to
You probably need to define your function as a C function, otherwise CPP
will mangle the name.

Michael Frayn <mfr...@home.com> wrote in article

<Xcru3.17970$C6.2...@news2.rdc1.on.home.com>...


> All I did was write a simple function in c:
>
> int square ( int x )
> {
> return x * x;
> }
>
> had a header file which just contained a forward declaration of the
> function, a cpp file which had the function itself, compiled it into a

0 new messages