openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] CreateDLL eliminates C style wrapper functions


From: Ger Hobbelt
Subject: Re: [Openexr-devel] CreateDLL eliminates C style wrapper functions
Date: Thu, 11 Mar 2010 00:00:53 +0100

I have an augmented CreateDLL tool available here (local version 1.2.5) which has been tested for a year on MSVC2k5/2k8 x86/x64 production environments. One of the (major?) changes in there is what it takes from the map files, and that includes 'extern "C" exports in particular as we use CreateDLL outside the OpenEXR realm, where we have several third party (OSS) libraries which export C++ and C functions; CreateDLL removed the necesity to manually maintain DEF files (a real nuisance) or tweak header files to add conditional __dllexport (or whatever that particular MSVC pragma incantation was again) which was a whole other level of nuisance too.

I promised to post it here about a year ago and never found a good excuse to take the time and actually do so.

It should work as a drop-in replacement of the current CreateDLL code; I can't guarantee success as I don't have your exact collection of items in use here (I don't use ImageMagick with OpenEXR), but if you're willing to give it a try, I can package ours and post it.
It comes with an augmented ChangeLog where the edits are described at a functional level, so it's not just a chunk of code gibberish landing on your lap.

(One issue the current CreateDLL tool in OpenEXR distros has is that it doesn't corectly drive the MSVC linker for X64 and Itanium targets.)

Re 'extern "C": those entries exist in the map files as long as you compile with /DEBUG flags to tell the compiler to spit out a full map file as required by the 'regular' CreateDDL tool as well (no change there); it's just that the exports are different for X64 and Itanium targets: x86 adds the well-known _ underscore prefix, while X64 leaves them out and (IIRC, it's been a while) Itanium adds a '.' dot. Anyway, our version recognizes and copes with those plus it allows some further MSVC linker support with regards to 'whole program optimization' which happens and linker time and you would lose with CreateDLL before as it wasn't able to pass through all those wicked command line switches.

Anyway, this is off the top of my head. Just give the word and a CreateDLL source will be on its way.



On Wed, Mar 10, 2010 at 5:57 PM, Stephan Menzel <address@hidden> wrote:
Hi guys,

I am currently trying to get OpenEXR to run in a multiplatform 32/64
bit Windows and Linux environment. So far I made quite OK progress
with adopting your build system to windows and enabling 64bit support.

There's just a big problem left: The createDLL tool, which I had to
modify according to
http://osdir.com/ml/video.openexr.devel/2007-11/msg00008.html
eliminates all the C style linkage wrapper functions from the DLL.
Specifically those in ImfCRgbaFile.h. The symbols in there are missing
in the DLLon both 32 and 64 bit windows. Unfortunately, the whole
purpose for this exercise for me is usage in ImageMagick and this uses
exactly those methods and none other. So even though I got the DLL I
still can't use it. And I have no idea how to modify createDLL any
further, because it's apparently the extern "C" linkage that messes
things up.

Have you guys any idea what I could do there?

I would be willing to contribute build system changes so you could
benefit from 64 bit support as well.

Cheers,
Stephan


_______________________________________________
Openexr-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/openexr-devel



--
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
       http://www.hebbut.net/
mail:   address@hidden
mobile: +31-6-11 120 978
--------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]