Sign in Join

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

Mailing lists / fpc-pascal / 2010-03

implicitly linking FPC-generated .dll from Visual Studio

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Seth Grover

First, let me declare my ignorance of MS development and Visual Studio in general.

I've got a FPC-generated .dll file I want to implicitly link with in a Visual Studio (Visual C++) project. If I understand what I'm reading, I have to have a "import library" .lib file which corresponds to my .dll. I don't see an obvious way to create this file using FPC directly.

Can anyone with experience using FPC-generated .dll's in VS help me out? So far my googling has turned up some MS tools (dumpbin.exe and imp.exe) which I can use to generate a .lib file from a .dll file (although in kind of a roundabout way), and I've also come up with ImpLib (http://implib.sourceforge.net) which has some tools (dll2def and fasm) which will generate a .def file and then a .lib file. Do I have to turn to third party tools to do this, or is there an easier way to generate what I need with FPC? What about the next step (actually using the .dll in Visual Studio)?

I realize this message is more about VS than FPC, so I apologize if it's offtopic.

Thanks,

-SG

This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover sethdgrover[at]gmail[dot]com

Reply by email

Henry Vermaak
to Seth Grover
Seth Grover wrote
First, let me declare my ignorance of MS development and Visual Studio in general.

You say it like it's a bad thing ;)

Show quoted text 5 lines
I've got a FPC-generated .dll file I want to implicitly link with in a Visual Studio (Visual C++) project. If I understand what I'm reading, I have to have a "import library" .lib file which corresponds to my .dll. I don't see an obvious way to create this file using FPC directly.

I've had to create import libs for mingw once, and used dlltool. I've found this information useful:

http://www.mingw.org/wiki/CreateImportLibraries

Also, if you're linking your library with ld, you can pass --out-implib to create it automatically.

Henry

Reply by email