I'm beginner at using Cgal . I'm trying to run the examples which included in the CGAl package, I built the examples using Cmake and "make" command.

but I'm facing a problem in including the header files to run CGAL examples

note: I'm using Qt creator software, Fedora OS

enter image description here enter image description here

  • I'm not convinced that there is a GIS component to this question which I think may be better researched/asked at Stack Overflow. – PolyGeo Oct 18 '17 at 9:04

Image showing how to select the target to run in QTCreator.

Image showing how to select the target to run in QTCreator.


If you use qtcreator, you can directly open the CMakeLists.txt file of the examples you want to compile and run (same for demo and tests).

By doing that, everything is configured and you can compile and run directly the examples within qtcreator (if you already have compiled and installed CGAL before).

See http://doc.cgal.org/latest/Manual/installation.html for the installation manual.

PS: For information, CGAL header files are in CGAL subdirectory thus you need to use #include <CGAL/XXX.h> (and not #include <XXX.h> directly).

  • thanks for help. but how to run "CMakeLists.txt" file , however his extension .txt? and I edit the source file and use #include <CGAL/XXX.h> as you recommended and worked but there is still errors about read "Combinatorial_map.h" methods ----- typedef CGAL::Combinatorial_map<3,Myitem> CMap_3; CMap_3 cm; // Create 2 hexahedra. Dart_handle dh1 = cm.make_combinatorial_hexahedron(); Dart_handle dh2 = cm.make_combinatorial_hexahedron(); -------------- cannot read any of "cm" attributes – n-m Feb 7 '17 at 15:13
  • First you are not supposed to edit CGAL files: examples and demo compiled without any modification. Second you will not run "CMakeLists.txt", but you can open it within qtcreator using "file/ open project". Third as suggested in my other answer, double check that you do not have two different version of cgal; and if this is the case I suggest you to remove your system version and use only a version or sources obtained from github. – gdamiand Feb 7 '17 at 23:04
  • I run the "CMakeLists.txt" file and run correctly the first example only in the file ? how to run other examples in the "CMakeLists.txt"? – n-m Feb 10 '17 at 2:19
  • When you open a "CMakeLists.txt" in qtcreator, is this "CMakeLists.txt" has several targets (case of CGAL examples) you can choose the target by clicking on the button representing a terminal (to the left and botton of QTCreator, cf snapshot attached). – gdamiand Feb 10 '17 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.