Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] compiling CGAL into a static library for use in a DLL

Subject: CGAL users discussion list

List archive

[cgal-discuss] compiling CGAL into a static library for use in a DLL


Chronological Thread 
  • From: Cody Rose <>
  • To:
  • Subject: [cgal-discuss] compiling CGAL into a static library for use in a DLL
  • Date: Tue, 04 Jun 2013 14:35:00 -0700

Hello,

I'd like to compile CGAL into a static library for use in a dynamic library we're distributing (we have a commercial license for this), but I'm having some trouble getting it to link. I can generate the static versions of the CGAL libraries fine (by unsetting BUILD_SHARED_LIBS in Cmake). When I try to build a static library or an .exe using them, everything is great, but when I try to build them into a .dll I get the following link errors:

libboost_thread-vc100-mt-gd-1_47.lib(thread.obj) : error LNK2005: "void __cdecl boost::detail::free_raw_heap_memory(void *)" (?free_raw_heap_memory@detail@boost@@YAXPAX@Z) already defined in boost_thread-vc100-mt-gd-1_47.lib(boost_thread-vc100-mt-gd-1_47.dll)
1>libboost_thread-vc100-mt-gd-1_47.lib(thread.obj) : error LNK2005: "void * __cdecl boost::detail::allocate_raw_heap_memory(unsigned int)" (?allocate_raw_heap_memory@detail@boost@@YAPAXI@Z) already defined in boost_thread-vc100-mt-gd-1_47.lib(boost_thread-vc100-mt-gd-1_47.dll)
1>libboost_thread-vc100-mt-gd-1_47.lib(thread.obj) : error LNK2005: "void __cdecl boost::detail::set_tss_data(void const *,class boost::shared_ptr<struct boost::detail::tss_cleanup_function>,void *,bool)" (?set_tss_data@detail@boost@@YAXPBXV?$shared_ptr@Utss_cleanup_function@detail@boost@@@2@PAX_N@Z) already defined in boost_thread-vc100-mt-gd-1_47.lib(boost_thread-vc100-mt-gd-1_47.dll)

This happens in release builds as well. Am I wrong that it should work? If not, how can I get it to work?

Thank you,
Cody Rose



Archive powered by MHonArc 2.6.18.

Top of Page