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

Marco, replying to me, wrote in part:

Show quoted text 10 lines
> The Problem: > > The problem is that I can't seem to figure out how to get FPC to link to > static libraries. FPC's linker won't look for the "Wrapper.lib". It > either wants "Wrapper.dll" or "Wrapper.lib.dll". I can compile wrapper.c > to an object module (in Visual C 6.0) and FPC will link to that object > file. FPC is link compatible with GCC, not with VC. IOW, recompile your sources with GCC.

I can only do that for a small part (the wrapper C code that I wrote). The main libraries were done by another company and they have the source--not me. I didn't understand the part about link compatibility--thanks, that helps! Now that I do, I know anything other than a DLL is a dead end, at least with FPC.

Another possibility might be to use Delphi for the Pascal side. Any thoughts? It sounds like there are a few people on this list who have some experience with Delphi. Would I be able to compile my TP code (with perhaps minor mods) and link it to Win32 static libraries for which I only have the compiled libraries and header files?

Thanks!

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

Lowell C. Savage napsal(a):

Show quoted text 13 lines
Marco, replying to me, wrote in part: > > The Problem: > > > > The problem is that I can't seem to figure out how to get FPC to link > to > > static libraries. FPC's linker won't look for the "Wrapper.lib". It > > either wants "Wrapper.dll" or "Wrapper.lib.dll". I can compile > wrapper.c > > to an object module (in Visual C 6.0) and FPC will link to that object > > file. > >FPC is link compatible with GCC, not with VC. IOW, recompile your sources >with GCC.

.
.

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

Reply by email