Search code examples
c++visual-studio-2010cgal

Building Visual C++ Applications with CGAL Library


I need to use delaunay traingulation (3D) method to be integrated in a Visual C++ project I am working with.

I followed the CGAL installation guide and was able to build it using cmake and so, however can someone please explain me in detail:

  1. How can I use (refer) CGAL in my own C++ project (in Visual Studios 2010),
  2. How can I create an standalone exe of my project afterwards.

Thanks!


Solution

  • I have also encountered the same problem. And below is my solutions (although my develop environment is VS 2015, I still believe it will work on your VS 2010).

    1. Add the 'include' folder under your 'CGAL' project home folder to the 'include directory' in your project configuration (please do not directly add the 'CGAL' folder, in order to cite the header file in 'CGAL/*.h' style.

    2. Here is the tricky part, copy the 'compiler_config.h' file under '/build/include/CGAL' folder to '/include' folder. This is to set the compiler definition for CGAL library on your PC.

    3. Download and extract GMP library and MPFR library to your drive, and also add these folders to the 'include directory' in your project configuration (this is mandatory for CGAL 4.9 at least, or you will receive some compile errors says 'cannot find gmp.h and mpfr*.h').

    4. Add the compiled static or dynamic libs of CGAL to the additional dependencies to the linker configuration tab under your project configuration.

    5. Compile and run (if you use dynamic libraries for CGAL, you also have to copy *.dll to your exe running folder)!