Forum > Windows (32/64)
Compiling a .dll
paul_H:
I'm trying to compile a VST plugin (.dll) that I wrote using Delphi. Up to now, with various help in these pages (thanks), I managed to successfully compile, using essentially my original delphi code (with very minor changes). Great!
Except, my VST host doesn't recognize the .dll and reports 'dispatcher not found'.
I have a feeling that this may be related to the configuration of the project or compiler/linker (because all my units are compiled successfully without errors (some hints mind you)).
Also, when I start from a new Library project and simply compile, Lazarus produces a .exe file instead of a .dll. This seems counter intuitive. Does Lazarus, by default, always produce a .exe even when compiling a .dll?
Any insight into these matters will be appreciated.
There is a whole world of eager VST developers out there that would love to be able to develop in pascal and also be able to build for Linux and Mac (myself included).
mschnell:
Sorry, I can't help with the problem :( .
Does your VST plugin done in Delphi actually work ?
I suppose your intention is to port it to Linux ?
What VST host in Linux do you intend to use ?
-Michael
duncanparsons:
VST and Delphi go very well together.
I'm just embarking on doing a similar thing to Paul.. From what I can see the problem relates to how the cdecl directive is handled. Delphi makes code which works flawlessly - however FPC doesn't appear to. Searching the forae here suggests that this is not an isolated case.
The VST spec required cdecl, and all hosts will be expecting this. However, the function which VST dlls export takes one parameter, and returns a value indicating success. It may be that for FPC we might be able to get away with 'stdcall' or 'pascal', tho' I doubt it...
reading the other posts around (they are few and far between, I get the feeling that cdecl isn't used much...), it seems that this is a known issue, and one that the FPC devs haven't been eager to resolve, alas.
DSP
Vincent Snijders:
--- Quote from: "duncanparsons" ---
reading the other posts around (they are few and far between, I get the feeling that cdecl isn't used much...), it seems that this is a known issue, and one that the FPC devs haven't been eager to resolve, alas.
DSP
--- End quote ---
What is the number of the fpc bug report describing this problem? I don't know if it has a simple test case, but if not, maybe you can create it.
paul_H:
Hi,
I think the problem has more to do with the way that Lazarus is creating .dlls than with the VST details.
I made a small test procedure. It consists of an application written in Lazarus called “test_dll.exe”. This application opens a window with two buttons. One button executes a procedure contained in a .dll written using Lazarus, and the other button executes a similar procedure contained in a .dll written in Delphi.
The code for both .dlls is essentially identical between Lazarus and Delphi. However, the Delphi .dll is successfully executed by the “test_dll.exe” and the Lazarus .dll causes an error.
I make the source code available for test routine and .dlls at this link.
Download DLL_Test.zip
Unizip to a temporary directory:
Under Lazarus open the “test_dll.lpi” project and compile.
Under Lazarus open the “mydll.lpi” project and compile.
Under Delphi open the “mydllD.dpr” project and compile.
Double click the “test_dll.exe” and try clicking the buttons.
The Lazarus compiled .dll does not work.
Maybe it's a config item - I don't know.
Complied using Lazarus 0.9.12 Beta.
Navigation
[0] Message Index
[#] Next page