使用mingw-w64交叉编译CGAL库时,我遇到了一些编译错误。我在一些论坛上读过CGAL未经mingw-w64测试的评论,尽管在CGAL文档中没有提到这一点。
以下是我遇到的错误。我在ArchLinux上使用mingw-w64
Run Build Command:"/usr/bin/make" "cmTC_f335f/fast"
/usr/bin/make -f CMakeFiles/cmTC_f335f.dir/build.make CMakeFiles/cmTC_f335f.dir/build
make[1]: Entering directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f335f.dir/print_GCC_version.cpp.obj
/usr/bin/i686-w64-mingw32-g++ -o CMakeFiles/cmTC_f335f.dir/print_GCC_version.cpp.obj -c /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/config/support/print_GCC_version.cpp
Linking CXX executable cmTC_f335f.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f335f.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/cmTC_f335f.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/cmTC_f335f.dir/objects.a @CMakeFiles/cmTC_f335f.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++ -Wl,--whole-archive CMakeFiles/cmTC_f335f.dir/objects.a -Wl,--no-whole-archive -o cmTC_f335f.exe -Wl,--out-implib,libcmTC_f335f.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_f335f.dir/linklibs.rsp
make[1]: Leaving directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
/usr/bin/i686-w64-mingw32-wine: line 20: wine: command not found
-- USING GCC_VERSION = 'unknown'
== Generate version files (DONE) ==
== Set up flags ==
-- Build type: Release
-- USING CXXFLAGS = ' -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4'
-- USING LDFLAGS = ' '
== Set up flags (DONE) ==
== Detect external libraries ==
-- External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
-- Preconfiguring library: GMP ...
-- Found GMP: /usr/i686-w64-mingw32/lib/libgmp.dll.a
-- GMP has been preconfigured:
-- UseGMP-file:
-- GMP include: /usr/i686-w64-mingw32/include
-- GMP libraries: /usr/i686-w64-mingw32/lib/libgmp.dll.a
-- GMP definitions:
-- WARNING: GMP found but print_GMP_version.cpp exited with error condition: 127
-- GMP_INCLUDE_DIR=/usr/i686-w64-mingw32/include
-- GMP_LIBRARIES=/usr/i686-w64-mingw32/lib/libgmp.dll.a
-- GMP_LIBRARIES_DIR=/usr/i686-w64-mingw32/lib
-- Change Dir: /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_f3997/fast"
/usr/bin/make -f CMakeFiles/cmTC_f3997.dir/build.make CMakeFiles/cmTC_f3997.dir/build
make[1]: Entering directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f3997.dir/print_GMP_version.cpp.obj
/usr/bin/i686-w64-mingw32-g++ @CMakeFiles/cmTC_f3997.dir/includes_CXX.rsp -o CMakeFiles/cmTC_f3997.dir/print_GMP_version.cpp.obj -c /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/config/support/print_GMP_version.cpp
Linking CXX executable cmTC_f3997.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f3997.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/cmTC_f3997.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/cmTC_f3997.dir/objects.a @CMakeFiles/cmTC_f3997.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++ -Wl,--whole-archive CMakeFiles/cmTC_f3997.dir/objects.a -Wl,--no-whole-archive -o cmTC_f3997.exe -Wl,--out-implib,libcmTC_f3997.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_f3997.dir/linklibs.rsp
make[1]: Leaving directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
/usr/bin/i686-w64-mingw32-wine: line 20: wine: command not found
-- USING GMP_VERSION = 'unknown'
-- Preconfiguring library: MPFR ...
-- Found MPFR: /usr/i686-w64-mingw32/lib/libmpfr.dll.a
-- MPFR has been preconfigured:
-- UseMPFR-file:
-- MPFR include: /usr/i686-w64-mingw32/include
-- MPFR libraries: /usr/i686-w64-mingw32/lib/libmpfr.dll.a
-- MPFR definitions:
-- WARNING: MPFR found but print_MPFR_version.cpp exited with error condition: 127
-- MPFR_INCLUDE_DIR=/usr/i686-w64-mingw32/include
-- MPFR_LIBRARIES=/usr/i686-w64-mingw32/lib/libmpfr.dll.a
-- MPFR_LIBRARIES_DIR=/usr/i686-w64-mingw32/lib
-- Change Dir: /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_0a17b/fast"
/usr/bin/make -f CMakeFiles/cmTC_0a17b.dir/build.make CMakeFiles/cmTC_0a17b.dir/build
make[1]: Entering directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0a17b.dir/print_MPFR_version.cpp.obj
/usr/bin/i686-w64-mingw32-g++ @CMakeFiles/cmTC_0a17b.dir/includes_CXX.rsp -o CMakeFiles/cmTC_0a17b.dir/print_MPFR_version.cpp.obj -c /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/config/support/print_MPFR_version.cpp
Linking CXX executable cmTC_0a17b.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0a17b.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/cmTC_0a17b.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/cmTC_0a17b.dir/objects.a @CMakeFiles/cmTC_0a17b.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++ -Wl,--whole-archive CMakeFiles/cmTC_0a17b.dir/objects.a -Wl,--no-whole-archive -o cmTC_0a17b.exe -Wl,--out-implib,libcmTC_0a17b.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_0a17b.dir/linklibs.rsp
make[1]: Leaving directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
/usr/bin/i686-w64-mingw32-wine: line 20: wine: command not found
-- USING MPFR_VERSION = 'unknown'
-- __cplusplus is /usr/bin/i686-w64-mingw32-wine: line 20: wine: command not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- thread
-- system
-- chrono
-- date_time
-- atomic
-- Boost include: /usr/i686-w64-mingw32/include
-- Boost libraries: /usr/i686-w64-mingw32/lib/libboost_thread-mt.dll.a;/usr/i686-w64-mingw32/lib/libboost_system-mt.dll.a;/usr/i686-w64-mingw32/lib/libboost_chrono-mt.dll.a;/usr/i686-w64-mingw32/lib/libboost_date_time-mt.dll.a;/usr/i686-w64-mingw32/lib/libboost_atomic-mt.dll.a
-- Boost definitions:
-- USING BOOST_VERSION = '1.64.0'
== Detect external libraries (DONE) ==
== Write compiler_config.h ==
-- Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Failed
-- Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Failed
-- Performing Test CGAL_CFG_IEEE_754_BUG - Failed
-- Performing Test CGAL_CFG_ISTREAM_INT_BUG - Failed
-- Performing Test CGAL_CFG_MATCHING_BUG_5 - Failed
-- Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
-- Performing Test CGAL_CFG_MATCHING_BUG_7 - Failed
-- Performing Test CGAL_CFG_MATCHING_BUG_8 - Failed
-- Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
-- Performing Test CGAL_CFG_NO_LIMITS - Failed
-- Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
-- Performing Test CGAL_CFG_NO_STL - Failed
-- Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Failed
-- Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Failed
-- Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Failed
-- Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Failed
-- Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Failed
== Write compiler_config.h (DONE) ==
== Generating build files ==
Configuring libCGAL
-- Requested component: MPFR
-- Requested component: GMP
libCGAL is configured
-- Sources for CGAL component library 'CGAL_Core' detected
Configuring libCGAL_Core
-- Requested component: MPFR
-- Requested component: GMP
-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- thread
-- system
-- chrono
-- date_time
-- atomic
libCGAL_Core is configured
-- Sources for CGAL component library 'CGAL_ImageIO' detected
Configuring libCGAL_ImageIO
-- Found ZLIB: /usr/i686-w64-mingw32/lib/libz.dll.a (found version "1.2.11")
-- WARNING: ZLIB found but print_ZLIB_version.cpp exited with error condition: 127
-- ZLIB_INCLUDE_DIR=/usr/i686-w64-mingw32/include
-- ZLIB_LIBRARIES=/usr/i686-w64-mingw32/lib/libz.dll.a
-- ZLIB_LIBRARIES_DIR=
-- Change Dir: /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_e29f4/fast"
/usr/bin/make -f CMakeFiles/cmTC_e29f4.dir/build.make CMakeFiles/cmTC_e29f4.dir/build
make[1]: Entering directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e29f4.dir/print_ZLIB_version.cpp.obj
/usr/bin/i686-w64-mingw32-g++ @CMakeFiles/cmTC_e29f4.dir/includes_CXX.rsp -o CMakeFiles/cmTC_e29f4.dir/print_ZLIB_version.cpp.obj -c /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/config/support/print_ZLIB_version.cpp
Linking CXX executable cmTC_e29f4.exe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e29f4.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/cmTC_e29f4.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/cmTC_e29f4.dir/objects.a @CMakeFiles/cmTC_e29f4.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++ -Wl,--whole-archive CMakeFiles/cmTC_e29f4.dir/objects.a -Wl,--no-whole-archive -o cmTC_e29f4.exe -Wl,--out-implib,libcmTC_e29f4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_e29f4.dir/linklibs.rsp
make[1]: Leaving directory '/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/CMakeFiles/CMakeTmp'
/usr/bin/i686-w64-mingw32-wine: line 20: wine: command not found
-- USING ZLIB_VERSION = 'unknown'
-- Requested component: MPFR
-- Requested component: GMP
libCGAL_ImageIO is configured
-- Sources for CGAL component library 'CGAL_Qt5' detected
-- Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt5' detected
== Generating build files (DONE) ==
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
SHARE_INSTALL_DIR
SYSCONF_INSTALL_DIR
-- Build files have been written to: /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32
Scanning dependencies of target CGAL
[ 11%] Building CXX object src/CGAL/CMakeFiles/CGAL.dir/all_files.cpp.obj
In file included from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Bbox_2.h:27:0,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Bbox_2_Line_2_intersection.h:29,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/src/CGAL/Bbox_2_intersections.cpp:27,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/src/CGAL/all_files.cpp:1:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/config.h:257:4: error: #error "This compiler does not have a working STL"
# error "This compiler does not have a working STL"
^~~~~
In file included from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/number_type_basic.h:57:0,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/basic.h:44,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Cartesian/Cartesian_base.h:28,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Simple_cartesian.h:28,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Bbox_2_Line_2_intersection_impl.h:31,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/src/CGAL/Bbox_2_intersections.cpp:28,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/src/CGAL/all_files.cpp:1:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h: In static member function ‘static CGAL::Interval_nt<Protected>::IA CGAL::Interval_nt<Protected>::smallest()’:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: error: ‘get_static_minimin’ is not a member of ‘CGAL::internal’
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:185:16: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
return IA(-CGAL_IA_MIN_DOUBLE, CGAL_IA_MIN_DOUBLE);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: note: suggested alternative:
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:185:16: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
return IA(-CGAL_IA_MIN_DOUBLE, CGAL_IA_MIN_DOUBLE);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:120:9: note: ‘get_static_minimin’
double& get_static_minimin(); // Defined in Interval_arithmetic_impl.h
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: error: ‘get_static_minimin’ is not a member of ‘CGAL::internal’
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:185:36: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
return IA(-CGAL_IA_MIN_DOUBLE, CGAL_IA_MIN_DOUBLE);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: note: suggested alternative:
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:185:36: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
return IA(-CGAL_IA_MIN_DOUBLE, CGAL_IA_MIN_DOUBLE);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:120:9: note: ‘get_static_minimin’
double& get_static_minimin(); // Defined in Interval_arithmetic_impl.h
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h: In function ‘CGAL::Interval_nt<Protected> CGAL::ldexp(const CGAL::Interval_nt<Protected>&, int)’:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: error: ‘get_static_minimin’ is not a member of ‘CGAL::internal’
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:737:36: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
scale == 0 ? CGAL_IA_MIN_DOUBLE : scale);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:70:49: note: suggested alternative:
# define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin())
^
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/Interval_nt.h:737:36: note: in expansion of macro ‘CGAL_IA_MIN_DOUBLE’
scale == 0 ? CGAL_IA_MIN_DOUBLE : scale);
^~~~~~~~~~~~~~~~~~
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/FPU.h:120:9: note: ‘get_static_minimin’
double& get_static_minimin(); // Defined in Interval_arithmetic_impl.h
^~~~~~~~~~~~~~~~~~
In file included from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/src/CGAL/Geomview_stream.cpp:28:0,
from /home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/build-i686-w64-mingw32/src/CGAL/all_files.cpp:10:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/IO/Geomview_stream_impl.h: At global scope:
/home/calegria/Software/aur/mingw/mingw-w64-cgal/src/CGAL-4.10/include/CGAL/IO/Geomview_stream_impl.h:607:5: warning: ‘CGAL::{anonymous}::dummy’ defined but not used [-Wunused-variable]
int dummy;
^~~~~
make[2]: *** [src/CGAL/CMakeFiles/CGAL.dir/build.make:64: src/CGAL/CMakeFiles/CGAL.dir/all_files.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:206: src/CGAL/CMakeFiles/CGAL.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
¿有人用mingw-w64成功编译了CGAL吗?
答案 0 :(得分:0)
我能够解决这个问题。我只需要安装wine,这样CMake就可以通过CMAKE_CROSSCOMPILING_EMULATOR变量将它用作模拟器。
如果你使用的是Arch Linux,那么pacing mingw-w64-cgal就可以了。