vs2008环境下cgal安装

感想 :CGAL是一个计算几何函数库,包含了计算几何领域绝大部分的计算。现在所做研究用到CGAL,安装的过程让我对它印象深刻。 安装cgal需要先安装好cmake,boost,qt三个环境,很是麻烦。在安装过程中翻阅了网上大量资料,终于成功安装好CGAL3.8。安装过程记录如下。
安装过程大致是基于官网上http://acg.cs.tau.ac.il/cgal-at-tau/installing-cgal-and-related-programs-on-windows的方法,在具体过程上有一些细节不一样。


download:
1,CMake 2.8.4: http://www.cmake.org/files/v2.8/cmake-2.8.4-win32-x86.exe
2,Boost 1.46.1: http://www.boostpro.com/download/boost_1_46_1_setup.exe
3,CGAL 3.8 https://gforge.inria.fr/frs/download.php/28508/CGAL-3.8-Setup.exe 
4,QT 4.7.1
   http://code.google.com/p/qt-msvc-installer/downloads/detail?name=qt-win32-opensource-4.7.1-vs2008.exe
    http://qt-msvc-installer.googlecode.com/files/Qt-Win32-4.7.1-pdb.zip
 

安装过程
(安装过程的每一步,都会导致环境变量的改变,将在每一步的后面注明,有些环境变量在安装过程中软件会自动添加,有些需要手工添加)
(我把环境安装在了"D:\cgal\"下,后面的路径都以此为基准)


CMAKE
 - Agree to the license.
 - Check "Add CMake to the system PATH for all users". We can check "create desktop icon".
 - Next, Next, Next.
 - Finish
 (cmake的安装一般很顺利,不会出什么问题!)
 环境变量:
 添加“D:\cgal\CMake 2.8\bin”到path中
 
Boost
 - Agree to both licenses.
 - Nearest SourceForge mirror.
 - Choose "Visual C++ 9.0 (Visual Studio 2008)" and the following variants: "Multithreaded" and "Multithreaded debug".
 - (最好是把所有组件都安装上,官网教程里说有些东西可以省略,实验过发现会导致后面问题,本人比较懒,就直接都安装上了)
 - Don't forget to check the "Add to path"

 - Install

(这一步需要注意的有两点,环境变量和必须安装必要的组件)

 环境变量:
 添加“D:\cgal\boost\boost_1_46_1”到path中
 新建环境变量BOOST_ROOT=“D:\cgal\boost\boost_1_46_1”
 
QT
 - Agree to the license.
 - Next, Next, Next, Install.
 - Add QTDIR variable with the value "D:\cgal\qt\4.7.1" to the environment variables (if it's not already there).
 - Add <QT>\bin to the system PATH. (D:\cgal\qt\4.7.1\bin)

 - Extract the Qt-Win32-4.7.1-pdb.zip files to the "bin" folder of the installed Qt to have the full distribution.

(这一步也不会出什么问题)

 环境变量:
 新建环境变量QTDIR="D:\cgal\qt\4.7.1"
 添加“D:\cgal\qt\4.7.1\bin”到path中
 
CGAL
安装
 - CGAL installation will need to connect to the internet for GMP and MPFR.(这是因为安装过程中需要下载一些东西,是在线安装的)
 - Be amazed by the splash screen.
 - Agree to the license.
 - Just choose the default: with GMP and MPFR, and with examples and demos.
 - 32-bit (for me).
 - In the "Setting Environment Variables" screen, choose all users and make sure that CGAL_DIR is checked.
 - Install.
 - Add <CGAL>\auxiliary\gmp\lib to the system PATH. (D:\cgal\CGAL-3.8\auxiliary\gmp\lib)
 
编译
 - Open CMake - cmake-gui (on the Desktop) - if you are using win7 make sure you open the program in administrator mode - right click on the icon and click on "run as administrator".
 - For both "Where is the source code" and "Where to build the binaries" specify the CGAL Installation folder (C:/Program Files/CGAL-3.7)
 - Click Configure.
 - Choose "Visual Studio 9 2008" and click "Finish"
 - Click Generate
 - A solution named CGAL was created in the directory.
 - Compile ALL_BUILD project both in Debug and Release.

 - All CGAL libraries should be under the lib directory. 

(编译cgal是最可能出问题的地方,因为前面任何一个部分安装不正确,比如有的环境变量没有设定好,有的组件没有安装等问题,都会导致这一步失败!)

 环境变量:
 Add <CGAL>\auxiliary\gmp\lib to the system PATH. (D:\cgal\CGAL-3.8\auxiliary\gmp\lib)
 新建环境变量CGAL_DIR=“D:\cgal\CGAL-3.8\”
 
Sanity check
 - Open CMake (cmake-gui, can be found on the desktop) - (for win7 users, use "Run as admin")
 - Choose "Where is the source code:" to be the Triangulation_2 demo directory under the CGAL installation. Namely, <CGAL>/demo/Triangulation_2 (C:/Program Files/CGAL-3.7/demo/Triangulation_2).
 - Choose "Where to build the binaries:" to the same directory.
 - Click Configure
 - Click Generate

 - Go to the directory (C:\Program Files\CGAL-3.7) and open the solution and compile. Run the Delaunay_triangulation project for check (in debug and release)

(这一步的成功说明cgal安装成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!要在 VS2022 上安装 CGAL(Computational Geometry Algorithms Library),您可以按照以下步骤进行操作: 1. 首先,确保您已经安装了 Visual Studio 2022。可以从官方网站(https://visualstudio.microsoft.com/)下载并安装最新版本的 Visual Studio。 2. 打开 Visual Studio 2022,点击 "工具" 菜单,选择 "选择工具和扩展管理器"。 3. 在弹出的对话框中,在左侧面板中选择 "个体开发人员和桌面开发",然后在右侧面板中选择 "C++ 的桌面开发"。 4. 在 "C++ 的桌面开发" 下方的组件列表中,确保选中了 "MSVC v142 - x64/x86 build tools" 组件。这个组件是用于构建 CGAL 的必需组件。 5. 继续滚动查找 "用于 Linux 开发的 C++ 工作负载" 组件,并确保选中了 "Linux 开发工具" 组件。这个组件包含了在 Windows 上使用 CGAL 时需要的一些 Linux 工具。 6. 点击 "修改" 按钮,等待安装完成。 7. 安装完成后,打开 CGAL 的官方网站(https://www.cgal.org/),在网站上下载适用于 Windows 的 CGAL 发行版。 8. 解压下载的 CGAL 压缩文件,并将文件夹移动到您希望安装 CGAL 的位置。 9. 打开 Visual Studio 2022,并创建一个新的 C++ 项目。 10. 在项目中,右键点击 "解决方案资源管理器" 中的 "属性",选择 "VC++ 目录"。 11. 在 "包含目录" 中,添加 CGAL 安装文件夹中的 "include" 文件夹路径。 12. 在 "库目录" 中,添加 CGAL 安装文件夹中的 "lib" 文件夹路径。 13. 在 "链接器" 的 "输入" 中,添加以下附加依赖项: - CGAL.lib - CGAL_Core.lib - gmp.lib 14. 保存并关闭属性页。 现在,您可以在您的项目中使用 CGAL 库了。请确保在编写代码时包含正确的头文件,并使用 CGAL 提供的函数和类来进行计算几何操作。祝您编写愉快的代码!如果还有任何问题,请随时向我提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值