问题
I have CGAL installed on my Mac OS X (10.8.4). I have successfully incorporated aspects of CGAL into previous C++ programs to compute the convex hull of a 3D point cloud. However, now I am trying to include other parts of CGAL for computing surface meshes, converting them to polyhedra, and so on. When I do that, the program compiles just fine, but then I receive linking errors that I don't understand.
Here is my linking command following compilation:
c++ -O2 -I/usr/local/include -I/usr/include -I/opt/local/include -o /Users/bullard/ShapeMetrology/Particle/bin/diffgeom diffgeom.a -L/usr/local/lib -L/usr/lib -L/opt/local/lib -lboost_math_c99 -lm -lCGAL -lCGAL_Core -lCGAL_ImageIO -lgmp
And here are the (rather verbose) linking errors I am receiving:
Undefined symbols for architecture x86_64: "boost::detail::get_tss_data(void const*)", referenced from: CGAL::Lazy, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval >::zero() in diffgeom.a(Particle.o) boost::thread_specific_ptr, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval > >::reset(CGAL::Lazy, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval >*) in diffgeom.a(Particle.o) CGAL::Lazy > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >::zero() in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::reset(CGAL::Lazy > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >*) in diffgeom.a(Particle.o) CGAL::Lazy > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >::zero() in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::reset(CGAL::Lazy > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >*) in diffgeom.a(Particle.o) "boost::detail::set_tss_data(void const*, boost::shared_ptr, void*, bool)", referenced from: boost::thread_specific_ptr, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval > >::reset(CGAL::Lazy, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval >*) in diffgeom.a(Particle.o) boost::thread_specific_ptr, CGAL::Gmpq, CGAL::Lazy_exact_nt, CGAL::To_interval > >::~thread_specific_ptr() in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::reset(CGAL::Lazy > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >*) in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Point_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::~thread_specific_ptr() in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::reset(CGAL::Lazy > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > >*) in diffgeom.a(Particle.o) boost::thread_specific_ptr > >, CGAL::Sphere_3 >, CGAL::Gmpq, CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > > > >::~thread_specific_ptr() in diffgeom.a(Particle.o) "_mpfr_clear", referenced from: CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > > (CGAL::Sphere_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >::operator() >(CGAL::Sphere_3 const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Point_3 > const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Sphere_3 > const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 >, CGAL::To_interval, CGAL::Sphere_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_z_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_z_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_z_3 > >, CGAL::CartesianKernelFunctors::Compute_z_3 >, CGAL::To_interval, CGAL::Point_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_y_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_y_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) ... "_mpfr_get_d", referenced from: CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > > (CGAL::Sphere_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >::operator() >(CGAL::Sphere_3 const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Point_3 > const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Sphere_3 > const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 >, CGAL::To_interval, CGAL::Sphere_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_z_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_z_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_z_3 > >, CGAL::CartesianKernelFunctors::Compute_z_3 >, CGAL::To_interval, CGAL::Point_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_y_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_y_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) ... "_mpfr_init2", referenced from: CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > > (CGAL::Sphere_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >::operator() >(CGAL::Sphere_3 const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Point_3 > const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Sphere_3 > const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 >, CGAL::To_interval, CGAL::Sphere_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_z_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_z_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_z_3 > >, CGAL::CartesianKernelFunctors::Compute_z_3 >, CGAL::To_interval, CGAL::Point_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_y_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_y_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) ... "_mpfr_set_q", referenced from: CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > > (CGAL::Sphere_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >::operator() >(CGAL::Sphere_3 const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Point_3 > const&) const in diffgeom.a(Particle.o) CGAL::Cartesian_converter, CGAL::Simple_cartesian >, CGAL::NT_converter > >::operator()(CGAL::Sphere_3 > const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 > >, CGAL::CartesianKernelFunctors::Compute_squared_radius_3 >, CGAL::To_interval, CGAL::Sphere_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_z_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_z_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) CGAL::Lazy_rep_1, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_z_3 > >, CGAL::CartesianKernelFunctors::Compute_z_3 >, CGAL::To_interval, CGAL::Point_3 >::update_exact() const in diffgeom.a(Particle.o) CGAL::cpp11::result_of > >, CGAL::CartesianKernelFunctors::Compute_y_3 > > (CGAL::Point_3)>::type CGAL::Lazy_construction_nt > >, CGAL::CartesianKernelFunctors::Compute_y_3 > >::operator() >(CGAL::Point_3 const&) const in diffgeom.a(Particle.o) ... ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: * [/Users/bullard/ShapeMetrology/Particle/bin/diffgeom] Error 1
Am I missing a CGAL library in the linking command? Again, I had no trouble when I was using CGAL just to compute a convex hull, but this problem seems to have arisen now that I am trying to include surface meshing.
I will be happy to post relevant parts of the code if that will help, but at this point I don't know which parts would be relevant.
来源:https://stackoverflow.com/questions/17581777/linking-error-with-cgal