在CGAL中运行程序“Hello World”

时间:2014-11-21 08:19:34

标签: visual-c++ cgal

我在Visual 2012 32bit中的CGAL安装时遇到错误。

我安装Boost和Cmake也成功配置和生成CGAL项目。

在发布和调试中重建ALL_BUILD,CGAL,Demo,Example ..项目,除INSTALL项目外都成功 我在这里重建INSTALL项目有问题:

Error 102 error MSB3073: The command "setlocal "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd:cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd :VCEnd" exited with code 1. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 134 5 INSTALL 然后,我复制了#Hello; Hello World"进入.cpp文件CGAL Project,成功重建。我很兴奋,但当我按本地窗口调试时,它说:无法启动程序' C :(项目名称)\ bin \ Release \ CGAL-vc-mt- 4.5.dll'

在这里,CMake说:

The CXX compiler identification is MSVC 17.0.50727.1
The C compiler identification is MSVC 17.0.50727.1
Check for working CXX compiler using: Visual Studio 11 2012
Check for working CXX compiler using: Visual Studio 11 2012 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working C compiler using: Visual Studio 11 2012
Check for working C compiler using: Visual Studio 11 2012 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
== Setting paths ==
Build CGAL from release in directory CGAL-4.5
Packagenames: CGAL-4.5
== Setting paths (DONE) ==

== Generate version files ==
CGAL_MAJOR_VERSION=4
CGAL_MINOR_VERSION=5
CGAL_BUGFIX_VERSION=0
CGAL_SONAME_VERSION=10
CGAL_SOVERSION     =10.0.4
CGAL_REFERENCE_CACHE_DIR=
Building shared libraries
Targetting Visual Studio 11 2012
Target build enviroment supports auto-linking
Using VC11 compiler.
Generator uses intermediate configuration directory: $(Configuration)
USING CMake version: 3.1.0
System: Windows
CMake Warning (dev) at CMakeLists.txt:437 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
details.  Use the cmake_policy command to set the policy and suppress this
warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

== Generate version files (DONE) ==

== Set up flags ==
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -    D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
USING LDFLAGS = ' /machine:X86 /INCREMENTAL:NO'
== 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: C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libgmp-10.lib  
GMP has been preconfigured:
UseGMP-file:      
GMP include:      C:/Program Files/CGAL-4.5/auxiliary/gmp/include
GMP libraries:    C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libgmp-10.lib
GMP definitions:  
USING GMP_VERSION = '5.0.1'
Preconfiguring library: MPFR ...
Found MPFR: C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libmpfr-4.lib  
MPFR has been preconfigured:
UseMPFR-file:      
MPFR include:      C:/Program Files/CGAL-4.5/auxiliary/gmp/include
MPFR libraries:    C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libmpfr-4.lib
MPFR definitions:  
USING MPFR_VERSION = '3.0.0'
Boost version: 1.57.0
Found the following Boost libraries:
thread
system
Boost include:     C:/boost_1_57_0
Boost libraries:   optimized;C:/boost_1_57_0/stage/lib/boost_thread-vc110-mt-        1_57.lib;debug;C:/boost_1_57_0/stage/lib/boost_thread-vc110-mt-gd-1_57.lib;optimized;C:/boost_1_57_0/stage/lib/boost_system-vc110-mt-1_57.lib;debug;C:/boost_1_57_0/stage/lib/boost_system-vc110-mt-gd-1_57.lib

提升定义:     使用BOOST_VERSION =' 1.57.0'     ==检测外部库(DONE)==

== Write compiler_config.h ==
Performing Test CGAL_CFG_BOOST_VARIANT_SWAP_BUG - Failed
Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success
Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Success
Performing Test CGAL_CFG_IEEE_754_BUG - Success
Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success
Performing Test CGAL_CFG_MATCHING_BUG_5 - Success
Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_7 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_8 - Success
Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
Performing Test CGAL_CFG_NO_LIMITS - Success
Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
Performing Test CGAL_CFG_NO_STL - Success
Performing Test CGAL_CFG_NO_WARNING_CPP_DIRECTIVE_BUG - Failed
Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success
Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success
Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Success
Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Success
Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success
== 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
libCGAL_Core is configured
Sources for CGAL component library 'CGAL_ImageIO' detected
Configuring libCGAL_ImageIO
Found OpenGL: opengl32  
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
OpenGL include:     
OpenGL libraries:   glu32;opengl32
Requested component: MPFR
Requested component: GMP
libCGAL_ImageIO is configured
NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.
Sources for CGAL component library 'CGAL_Qt3' detected
Configuring libCGAL_Qt3
libCGAL_Qt3 needs Qt3, cannot be configured.
Sources for CGAL component library 'CGAL_Qt4' detected
Configuring libCGAL_Qt4
libCGAL_Qt4 needs Qt4, cannot be configured.
Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt4' detected
== Generating build files (DONE) ==

Configuring done
Generating done

我希望你能尽快帮助我。非常感谢你。

1 个答案:

答案 0 :(得分:0)

我得到完全相同的错误。我意识到,当我通过VS 2010命令提示符构建QGLViewer时,它为manipulatedFrame.cpp< 244>提供了一个错误。错误是关于变量类型。

所以在manipulatedFrame.cpp中,我改变了第244行;

const qreal dist = sqrt(delta.x()*delta.x() + delta.y()*delta.y());

到这一行;

const qreal dist = sqrt(((double)(delta.x()))*((double)(delta.x())) + ((double)(delta.y()))*((double)(delta.y())));

再次构建它。现在好像很好。