Board index » delphi » Linking Delphi files with msvc obj/lib-files.

Linking Delphi files with msvc obj/lib-files.

Hello !

Today I use a C/C++ compiler from Intel (very good) which got some intrinsic
functions for MMX (PII,PIII and P4). This compiler runs under the MSVC IDE
(instead of Microsoft's own C/C++ compiler, but uses the MSVC linker).
This compiler generates the same obj files as the MSVC compiler does.

So far I have been building a DLL which I call from my Delphi application,
but I would like to link all these files together into one exe-file !

Does anyone got an idea on how to link obj-files and/or lib-files generated
in MSVC together with dcu files for Delphi/C++ Builder ?

Thank's in advance
Perre

 

Re:Linking Delphi files with msvc obj/lib-files.


I've never succeeded with this, yet help is pretty clear with what you have
to do.

a) Indicate the object file with the $L directive
{$L Test.obj}

b) Declare the function you wish to use in the object file as external

function AddOne(iNum: integer): integer;cdecl;external;

If the compiler can't find the file you get a sensible error saying as much.
If the file isn't of an acceptable type, you also get a meaningful error
message.

However, what you normally get is 'unsatisfied forward declaration' as if
the reference to AddOne() doesn't exist in the object file. If you look
through the object file you can find its reference OK as _AddOne which
should be OK.

With the C++ compilers I force C linkage with the extern "C" { } directive.

I've tried using obj files from Builder 5, VC6, and all four of CVIs
compatability modes with no success.

Any clues????

Dave

Quote
Perre <p...@sonomed.no> wrote in message

news:zNIQ6.2785$vu4.279045@news3.oke.nextra.no...
Quote
> Hello !

> Today I use a C/C++ compiler from Intel (very good) which got some
intrinsic
> functions for MMX (PII,PIII and P4). This compiler runs under the MSVC IDE
> (instead of Microsoft's own C/C++ compiler, but uses the MSVC linker).
> This compiler generates the same obj files as the MSVC compiler does.

> So far I have been building a DLL which I call from my Delphi application,
> but I would like to link all these files together into one exe-file !

> Does anyone got an idea on how to link obj-files and/or lib-files
generated
> in MSVC together with dcu files for Delphi/C++ Builder ?

> Thank's in advance
> Perre

Re:Linking Delphi files with msvc obj/lib-files.


Im Artikel <zNIQ6.2785$vu4.279...@news3.oke.nextra.no>, "Perre"
<p...@sonomed.no> schreibt:

Quote
>This compiler generates the same obj files as the MSVC compiler does.

That's the problem: Delphi cannot handle these COFF object files :-(

I'm not sure, but what if you let Delphi create object files, and link them
with VC?

Another question, to the lurkers: can Delphi 6 handle COFF object files?

DoDi

Other Threads