CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.89k stars 1.38k forks source link

compiling Triangulation_2 example error #8154

Closed Lanjiong-Li closed 5 months ago

Lanjiong-Li commented 5 months ago

Issue Details

I am following the CGAL 5.6.1 Tutorial, Quick Start: Compiling a Program using CGAL. I use brew install cgal to download cgal, and then run: cd $HOME/CGAL-5.6.1/examples/Triangulation_2 # go to an example directory cmake -DCMAKE_BUILD_TYPE=Release . # configure the examples make # build the examples Here is the error: [ 96%] Linking CXX executable qrc_CGAL cd /Users/llj/Downloads/CGAL-5.6.1/examples/Triangulation_2/examples/Triangulation_2 && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/qrc_CGAL.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/qrc_CGAL.dir/qrc_CGAL.cpp.o -o qrc_CGAL -F/opt/homebrew/opt/qt@5/lib ../Arrangement_on_surface_2/libCGAL_Qt5_moc_and_resources.a /opt/local/lib/libgmpxx.dylib /opt/local/lib/libmpfr.dylib /opt/local/lib/libgmp.dylib /opt/homebrew/opt/qt@5/lib/QtSvg.framework/QtSvg /opt/homebrew/opt/qt@5/lib/QtOpenGL.framework/QtOpenGL /opt/homebrew/opt/qt@5/lib/QtWidgets.framework/QtWidgets /opt/homebrew/opt/qt@5/lib/QtGui.framework/QtGui /opt/homebrew/opt/qt@5/lib/QtCore.framework/QtCore Undefined symbols for architecture arm64: "_main", referenced from:

ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [examples/Triangulation_2/qrc_CGAL] Error 1 make[1]: *** [examples/Triangulation_2/CMakeFiles/qrc_CGAL.dir/all] Error 2 make: *** [all] Error **2** ## Environment * Operating system (Windows/Mac/Linux, 32/64 bits): MacbookAir_M2_MacOS14.4.1 * Compiler: Apple clang version 15.0.0 (clang-1500.3.9.4) * Release or debug mode: Release * Specific flags used (if any): -DCMAKE_BUILD_TYPE=Release * CGAL version: 5.6.1 * Boost version: boost 1.84.0_1