Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] MinGW issues

Subject: CGAL users discussion list

List archive

[cgal-discuss] MinGW issues


Chronological Thread 
  • From: xantares 09 <>
  • To: "" <>
  • Subject: [cgal-discuss] MinGW issues
  • Date: Wed, 26 Nov 2014 14:59:46 +0000
  • Importance: Normal

Hello,

I've got issues cross-compiling CGAL 4.5 with MinGW64 (mingw-gcc 4.9.1) from
linux (x86_64 host).


1. There's a compilation error with the x86_64 target:

Scanning dependencies of target CGAL

mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h: In function 'double
CGAL::sse2fabs(double)':

mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:132:10: error:
'CGAL_ALIGN_16' does not name a type

   static CGAL_ALIGN_16 const union{

          ^

mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:135:5: error: 'absMask' was
not declared in this scope

   } absMask = {0x7fffffffffffffff, 0x7fffffffffffffff};

     ^

mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:135:54: warning:
extended initializer lists only available with -std=c++11 or
-std=gnu++11 [enabled by default]

   } absMask = {0x7fffffffffffffff, 0x7fffffffffffffff};

                                                      ^

src/CGAL/CMakeFiles/CGAL.dir/build.make:58: recipe for target 'src/CGAL/
CMakeFiles/CGAL.dir/all_files.cpp.obj' failed


But if I replace _MSC_VER by _WIN32 in include/CGAL/sse2.h, both i686 and
x86_64 targets are fine:

#if defined ( _WIN32 )
#define CGAL_ALIGN_16  __declspec(align(16))
#elif defined( __GNU__ )
#define  CGAL_ALIGN_16 __attribute__((aligned(16)))
#endif





2. Export libraries (.dll) are properly installed to <PREFIX>/bin and import
libraries (.dll.a) to <PREFIX>/lib.

But in the CGALConfig.cmake file, the CGAL*_LIBRARY vars refer to
the export library name in <PREFIX>/lib:

set(CGAL_LIBRARY         "/usr/i686-w64-mingw32/lib/libCGAL.dll")

it should be the import library:
set(CGAL_LIBRARY         "/usr/i686-w64-mingw32/lib/libCGAL.dll.a")



Regards



Archive powered by MHonArc 2.6.18.

Top of Page