Am 08. Aug 2013, 08:19 schrieb Mark Flamer <
ma...@flamerassoc.com>:
> I'm planning on trying to get a .dll built using minGW and linking
> with a program compiled in VisualStudio2012 using a process like this
>
http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs. Has anyone tried this?
> Does anyone know offhand if this is impossible and I'm wasting my
> time? Thanks.
There is a big obstacle you have to be aware of, namely, deal.II does
not annotate global symbols with visibility rules (under *nix) or
__declspec(dllexport)/__declspec(dllimport) rules (under Windows).
There is a workaround when using only mingw to get the Unix behaviour
(where every symbol is exported/imported by default).
But I'm not aware of any method to provide this for MSVC.
So if you're still into giving this a try I suggest that you first of
all, try to build a dll with MinGW that you can successfully link
against with MinGW.
For that, go to cmake/checks/check_02_system_features.cmake and remove
lines 118-124 that disable shared libraries under Windows.
You might have to specify something like
-DDEAL_II_LINKER_FLAGS="-Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--allow-multiple-definition"
when configuring deal.II. After that just try to compile and run an
example.
And,..., don't try too hard. CYGWIN and MinGW support is currently
very limited...
Best,
Matthias
[1]
http://www.mingw.org/wiki/sampleDLL