Build Dealii using minGW on Windows7

38 views
Skip to first unread message

Mark Flamer

unread,
Aug 8, 2013, 1:54:44 AM8/8/13
to dea...@googlegroups.com
I have configured using CMake and when I try to build I get the following errors. Does anyone have any idea what the problem might be? Thanks.


C:\Users\mflamer>cd C:\deal.II
....................................................
.....................
....................................................

C:\deal.II\bundled\tbb41_20130401oss\src\tbb\dynamic_link.cpp: In function 'void
 tbb::internal::init_ap_data()':
C:\deal.II\bundled\tbb41_20130401oss\src\tbb\dynamic_link.cpp:219:13: error: 'Ge
tModuleHandleEx' was not declared in this scope
C:\deal.II\bundled\tbb41_20130401oss\src\tbb\dynamic_link.cpp: In function 'HINS
TANCE__* tbb::internal::global_symbols_link(const char*, const tbb::internal::dy
namic_link_descriptor*, size_t)':
C:\deal.II\bundled\tbb41_20130401oss\src\tbb\dynamic_link.cpp:424:61: error: 'Ge
tModuleHandleEx' was not declared in this scope
mingw32-make.exe[2]: *** [bundled/tbb41_20130401oss/src/CMakeFiles/obj_tbb.debug
.dir/tbb/dynamic_link.cpp.obj] Error 1
mingw32-make.exe[1]: *** [bundled/tbb41_20130401oss/src/CMakeFiles/obj_tbb.debug
.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2

C:\deal.II>

Mark Flamer

unread,
Aug 8, 2013, 2:04:57 AM8/8/13
to dea...@googlegroups.com
I think the problem was that the threads option was enabled. I disabled that option and am now past that part of the build. Hopefully I'll be in business shortly!

Mark Flamer

unread,
Aug 8, 2013, 2:19:31 AM8/8/13
to dea...@googlegroups.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. 


On Wednesday, August 7, 2013 10:54:44 PM UTC-7, Mark Flamer wrote:

Matthias Maier

unread,
Aug 8, 2013, 2:55:57 AM8/8/13
to dea...@googlegroups.com

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
Reply all
Reply to author
Forward
0 new messages