Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-08

Re: Linking Pascal code to C/C++ static libraries under Windows

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lowell C. Savage

I would also have thought that with all the object formats that GCC emits, that one of them would be the object format used by VC, in which case using VC's linker would work.

However, I was able to get a DLL compiled that I could link up and run (without getting an error that the DLL was missing when the program started.)

I hope to get some time in the next few days to put together a simple tutorial/sample showing how to do it.

Thanks Marco, for the help!

Lowell

Tomas Hajny wrote 9 lines
Out of curiosity - is this limitation related to different object library format used/supported by GCC and VC, or yet something else? If it's just the format, there might be tools to translate from one format to another (although there might be limitations, of course), or it _might_ be possible (with some manual tweaking - for sure not easy) to use a linker supporting both formats (I'd expect OpenWatcom Linker to be able to do it)... Tomas

Lowell C. Savage

505-667-6964 (office/msg)
360-961-8965 (cell/msg)
505-667-4341 (shared fax)

Reply by email

Tomas Hajny
to Lowell C. Savage

Date sent: Thu, 18 Aug 2005 11:48:32 -0600
To:
From: "Lowell C. Savage"
Subject: Re: [fpc-pascal] Linking Pascal code to C/C++ static libraries under Windows
Send reply to: FPC-Pascal users discussions

I would also have thought that with all the object formats that GCC emits, that one of them would be the object format used by VC, in which case using VC's linker would work.

Well, I didn't think about this path (compiling FPC program to MS object file format and using the MS linker), although _in_theory_ this might be an option too by using one of external assemblers supported in FPC which would be capable of creating the required object format (e.g. NASM?) for MS linker (I'd expect even more problems there, though).

Show quoted text 6 lines
However, I was able to get a DLL compiled that I could link up and run (without getting an error that the DLL was missing when the program started.) I hope to get some time in the next few days to put together a simple tutorial/sample showing how to do it.

Glad to hear that you have succeeded.

Tomas

Reply by email