[perl #44855] [BUG] msvc: embedders can't link against libparrot.dll

Will Coleda via RT parrotbug-followup at parrotcode.org
Tue Nov 17 03:49:03 UTC 2009

On Wed Aug 22 09:08:49 2007, mark at glines.org wrote:
> t/src/compiler.t fails on msvc/win32 because the linker can't find the
> PMCNULL variable.  Apparently this symbol is exported by the dll
> properly, but not imported by the embedded application properly.

I can't find this test or any reference to this RT in the t/ suite. Rejecting this apparently 
obsolete ticket, sorry.


> The background:
> 11:19 <@Ron> The story goes like this.
> 11:19 <@Ron> When building a DLL you need to tell the compiler to
> export the symbol.
> 11:20 <@Ron> This is done by __declspec(dllexport).
> 11:20 <@Ron> When using the DLL you need to tell the compiler to
> import it, with __declspec(dllimport).
> 11:21 <@Ron> This is done in include/parrot/config.h, but tied to
> 11:22 <@Ron> Which makes sense, because it was mostly relevant for the
> extensions, which are separate shared objects, linked against
> libparrot.
> The problem:
> Embedded applications (such as those compiled by t/src/compiler.t) do
> not get the __declspec(dllimport) tag defined properly, and thus, do
> not import symbols from the dll correctly.  This prevents third party
> applications from embedding parrot, by linking against libparrot.
> The proposed solution:
> 11:46 <@Ron> Infinoid, how about this.
> 11:46 <@Ron> in config.h, PARROT_API uses dllimport by default.
> 11:46 <@Ron> only uses dllexport if PARROT_EXPORTS is defined.
> 11:47 <@Ron> When compiling the sources that belong to libparrot.lib
> we'd need to define PARROT_EXPORTS.
> 11:48 <@Infinoid> will that be a headerfile define, or passed on the
> compiler command-line?
> 11:48 <@Ron> I think passed on the command line.
> The tests in t/src/compiler.t are skipped so it'll pass today's 0.4.15
> release, but should be unskipped for testing whether this issue is
> resolved.
> Mark

Will "Coke" Coleda

More information about the parrot-dev mailing list