CGAL+VS2015+QT Configuration

Source: Internet
Author: User
Tags gmp

Because the Cgal computational Geometry algorithm Library was used in the lab project, I groped for the configuration of Cgal.

Cgal is a particularly powerful open Source library for computational geometry algorithms . Connect to an official website: http://www.cgal.org/, you can download the source code for GitHub on the website.


First, say the requirements for cgal configuration. Before configuring Cgal, you need the boost library to install CMake and QT. Many versions are not necessarily compatible , and pro-test boost1.6+cmake3.5+qt5+vs2015 is possible. By the way, the Cgal library is written based on the boost library, so be sure to configure boost first and then install Cgal.

QT can choose not to, because it is relatively large, installation is more laborious, but the Cgal example can only use QT to run.

Installation of CMake and QT is needless to say, the next step directly next to the two download the website link:

cmake:https://cmake.org/

qt:https://www.qt.io/download/


Next we start configuring.

1, boost. : http://www.boost.org/

After downloading, unzip, a little bit larger. After extracting the folder, you can see that there is a bootstrap.bat file.

Hold down SHIFT and right-click here to open the Command window. input Bootstrap.bat

After executing the above command, the following EXE file is generated in the installation directory.

Continue to enter Bjam.exe in the DOS window, the program will automatically select the appropriate library files and include files according to the compilation environment (VS2010,VS2012,VS2013) you are currently installing.

There is also an important step to add a ring boundary variable : boost_ ROOT: The installation path of the file (the folder containing the Bootstrap.bat, such as my: C:\boost_1_60_0), Boost_librarydir: The folder where the class library is located ( For example my is : C:\boost_1_60_0\stage\lib)

2, Cgal

Download Cgal Setup.exe, and run directly (always next, I installed in the C drive, other disks should also be possible)

Because my VS2015 works to use 64 bit, so Cgal install 64 bit! Cgal-releases-cgal-4.8.zip is the source code for the library.


After installation, there will be a file in the C drive:


The next step is to use the cmake.

Open the Cmake,source folder path to the CmakeList.txt location, the build folder path will write the path where you want to put the new project where it was built (like mine, for example).


Then click on Configure, will let you choose the compiler, I use the VS2015, so choose 2015, 64 bit.

If there is an error in this step, usually the path is not set to, such as the path of QT does not give the CMAK such as errors, look at the path of the error, manually change it. If there is no mistake, click Generate, there will be a CGAL.sln in the output path you choose.

Click to run the project,Debug and Release mode are run again. The following dynamic libraries are generated:

With the D is the debug generated, not with the release generated. So the Cgal is well-configured.

We verify that the sample with Qt installed can run Cgal, without QT installation, we create a new VS2015 project.

Create a new console project in VS2010:

Right-click on the project name-"Properties-" VC + + Directory:
Include directory join: cgal installation path \include; Cgal installation path \auxiliary\gmp\include; Boost installation path; Cgal compiled output path \include (for example, mine)
Library directory join: cgal output directory \lib; Cgal installation path \auxiliary\gmp\lib; Boost Installation path \stage\lib

(for example, mine)

Linker--input-to-attach dependency:

Add the name of all Lib, here to my, as my version can be copied directly:

Libboost_atomic-vc140-mt-1_60.lib
Libboost_atomic-vc140-mt-gd-1_60.lib
Libboost_chrono-vc140-mt-1_60.lib
Libboost_chrono-vc140-mt-gd-1_60.lib
Libboost_container-vc140-mt-1_60.lib
Libboost_container-vc140-mt-gd-1_60.lib
Libboost_context-vc140-mt-1_60.lib
Libboost_context-vc140-mt-gd-1_60.lib
Libboost_coroutine-vc140-mt-1_60.lib
Libboost_coroutine-vc140-mt-gd-1_60.lib
Libboost_date_time-vc140-mt-1_60.lib
Libboost_date_time-vc140-mt-gd-1_60.lib
Libboost_exception-vc140-mt-1_60.lib
Libboost_exception-vc140-mt-gd-1_60.lib
Libboost_filesystem-vc140-mt-1_60.lib
Libboost_filesystem-vc140-mt-gd-1_60.lib
Libboost_graph-vc140-mt-1_60.lib
Libboost_graph-vc140-mt-gd-1_60.lib
Libboost_iostreams-vc140-mt-1_60.lib
Libboost_iostreams-vc140-mt-gd-1_60.lib
Libboost_locale-vc140-mt-1_60.lib
Libboost_locale-vc140-mt-gd-1_60.lib
Libboost_log_setup-vc140-mt-1_60.lib
Libboost_log_setup-vc140-mt-gd-1_60.lib
Libboost_log-vc140-mt-1_60.lib
Libboost_log-vc140-mt-gd-1_60.lib
Libboost_math_c99f-vc140-mt-1_60.lib
Libboost_math_c99f-vc140-mt-gd-1_60.lib
Libboost_math_c99l-vc140-mt-1_60.lib
Libboost_math_c99l-vc140-mt-gd-1_60.lib
Libboost_math_c99-vc140-mt-1_60.lib
Libboost_math_c99-vc140-mt-gd-1_60.lib
Libboost_math_tr1f-vc140-mt-1_60.lib
Libboost_math_tr1f-vc140-mt-gd-1_60.lib
Libboost_math_tr1l-vc140-mt-1_60.lib
Libboost_math_tr1l-vc140-mt-gd-1_60.lib
Libboost_math_tr1-vc140-mt-1_60.lib
Libboost_math_tr1-vc140-mt-gd-1_60.lib
Libboost_prg_exec_monitor-vc140-mt-1_60.lib
Libboost_prg_exec_monitor-vc140-mt-gd-1_60.lib
Libboost_program_options-vc140-mt-1_60.lib
Libboost_program_options-vc140-mt-gd-1_60.lib
Libboost_random-vc140-mt-1_60.lib
Libboost_random-vc140-mt-gd-1_60.lib
Libboost_regex-vc140-mt-1_60.lib
Libboost_regex-vc140-mt-gd-1_60.lib
Libboost_serialization-vc140-mt-1_60.lib
Libboost_serialization-vc140-mt-gd-1_60.lib
Libboost_signals-vc140-mt-1_60.lib
Libboost_signals-vc140-mt-gd-1_60.lib
Libboost_system-vc140-mt-1_60.lib
Libboost_system-vc140-mt-gd-1_60.lib
Libboost_test_exec_monitor-vc140-mt-1_60.lib
Libboost_test_exec_monitor-vc140-mt-gd-1_60.lib
Libboost_thread-vc140-mt-1_60.lib
Libboost_thread-vc140-mt-gd-1_60.lib
Libboost_timer-vc140-mt-1_60.lib
Libboost_timer-vc140-mt-gd-1_60.lib
Libboost_type_erasure-vc140-mt-1_60.lib
Libboost_type_erasure-vc140-mt-gd-1_60.lib
Libboost_unit_test_framework-vc140-mt-1_60.lib
Libboost_unit_test_framework-vc140-mt-gd-1_60.lib
Libboost_wave-vc140-mt-1_60.lib
Libboost_wave-vc140-mt-gd-1_60.lib
Libboost_wserialization-vc140-mt-1_60.lib
Libboost_wserialization-vc140-mt-gd-1_60.lib
Libgmp-10.lib
Libmpfr-4.lib
Gmp. COPYING. Lib
Cgal_core-vc140-mt-gd-4.8.lib
Cgal_imageio-vc140-mt-gd-4.8.lib
Cgal_qt5-vc140-mt-gd-4.8.lib
Cgal-vc140-mt-gd-4.8.lib

If the compile run prompt does not find the Cgal_......_4.8.dll,
Under the Bin folder (E:\VS2015_Project\CGAL\bin) that runs the Cgal library, copy to the running directory of the new project.

now you can directly reference The functions provided by the Cgal library perform computer geometry operations ~ ~

For example, when referencing a header file:


If there is no successful configuration, you will be prompted to find the header file, it should be a path problem.

CGAL+VS2015+QT Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.