Page 1 of 1

Creating a .lib from the .dll

Posted: 14 Nov 2006 12:14
by Kleus
Hello,

I've got a little question.
For school we're working with VLC, and we're trying to implement the VLC dll file into our own Borland C++ program. The problem is: it isn't prossible to link a .dll directly too your project, so we have to make a .lib for the .dll. With the .lib it should be possible to link to the .dll.

We've already tried to build a .lib from the .dll using the program "DLL to Lib". But the created .lib file still gives trouble in Borland. Do you guys have any idea how to create a working .lib file?

We're using the latest VLC package, named vlc-0.8.5-win32.zip and the libvlc.dll that came with it.

I hope someone can help us, so we can use the library...

Greetings,

Bas

Posted: 14 Nov 2006 17:11
by VLC_help
You should try devs IRC channel.
* IRC network: irc.videolan.org
* Channel: #videolan

Posted: 14 Nov 2006 21:49
by RĂ©mi Denis-Courmont
I am not sure if the DLL is really useable with anything except code built with the same compiler. I suspect we don't use the same calling convention as Borland C++. Even if we do, you would still need the C header files which are very unlikely to work properly on anything but GCC.

I would strongly advise you use the ActiveX plugin instead. This one should be easy to link with.

Posted: 15 Nov 2006 08:03
by Odysee
Or use the WinAPI with LoadLibrary an GetProcArddress.
I have tried this, and it works fine in VS2005 (C++ and c#).

You must only copy some structs from the oriiginal headers !

Try Dumpbin

Posted: 15 Nov 2006 19:35
by Tappen
You can use dumpbin.exe /exports on libvlc.dll to get the functions that are exported and build your own .def file with the ordinals of the functions you want to import. Ignore all the functions that begin with an underscore: they're c++ mangled names that won't work from Borland C++. The other functions should be Pascal calling convention and if you look in the source code you'll be able to write good header files for them.

Posted: 16 Nov 2006 14:02
by Kleus
Thanks for all your options.

We've already tried the ActiveX component, but it isn't working in Borland. It isn't possible then to create a VCLPlugin class, cause it's abstract or something.... Do we have to make an class which inherits from the VCLPlugin?

Right now we're trying to compile some stuff using Cygwin.
And besides all this we're trying all the options by using Visual Studio 2005....

Hope it will work, eventually

Bas

Posted: 04 May 2007 22:01
by loic69
Hi some news of Visual Studio ?