2012-01-13 5 views
2

EclipseでOS X 10.7でCGALを使用しようとしています。私はMacPorts経由でCGALをインストールし、/ opt/local/includeをインクルードリストに追加することでEclipseに認識させました。今私はリンカのエラーを取得します。私はここで少し失われています、何か提案がありますか?OSX上でEclipseのCGAL

make all 
Building file: ../hit.cpp 
Invoking: Cross G++ Compiler 
g++ -I/opt/local/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"hit.d" -MT"hit.d" -o "hit.o" "../hit.cpp" 
Finished building: ../hit.cpp 

Building target: Hit 
Invoking: Cross G++ Linker 
g++ -o "Hit" ./hit.o 
Undefined symbols for architecture x86_64: 
    "CGAL::assertion_fail(char const*, char const*, int, char const*)", referenced from: 
     CGAL::Interval_nt<false>::Interval_nt(double)in hit.o 
     CGAL::Interval_nt<false>::Interval_nt(double, double)in hit.o 
     bool CGAL::get_certain<bool>(CGAL::Uncertain<bool>)in hit.o 
     CGAL::Interval_nt<false>::Test_runtime_rounding_modes::Test_runtime_rounding_modes()in hit.o 
     CGAL::Interval_nt<true>::Test_runtime_rounding_modes::Test_runtime_rounding_modes()in hit.o 
     CGAL::Gmpq::Gmpq(double)in hit.o 
     bool CGAL::internal::seg_seg_do_intersect_crossing<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >(CGAL::Simple_cartesian<CGAL::Interval_nt<false> >::Point_2 const&, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >::Point_2 const&, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >::Point_2 const&, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >::Point_2 const&, CGAL::Simple_cartesian<CGAL::Interval_nt<false> > const&)in hit.o 
     ... 
    "___gmpq_init", referenced from: 
     CGAL::Gmpq_rep::Gmpq_rep()in hit.o 
    "___gmpq_clear", referenced from: 
     CGAL::Gmpq_rep::~Gmpq_rep()in hit.o 
    "boost::detail::set_tss_data(void const*, boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)", referenced from: 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::~thread_specific_ptr()in hit.o 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::~thread_specific_ptr()in hit.o 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::reset(CGAL::Lazy<CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >*)in hit.o 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::reset(CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >*)in hit.o 
    "boost::detail::get_tss_data(void const*)", referenced from: 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::get() constin hit.o 
     boost::thread_specific_ptr<CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >::get() constin hit.o 
    "CGAL::precondition_fail(char const*, char const*, int, char const*)", referenced from: 
     CGAL::Handle::Handle(CGAL::Handle const&)in hit.o 
     CGAL::Handle::operator=(CGAL::Handle const&)in hit.o 
     CGAL::Uncertain<bool>::Uncertain(bool, bool)in hit.o 
     CGAL::Uncertain<CGAL::Sign>::Uncertain(CGAL::Sign, CGAL::Sign)in hit.o 
    "_mpfr_init2", referenced from: 
     CGAL::Real_embeddable_traits<CGAL::Gmpq>::To_interval::operator()(CGAL::Gmpq const&) constin hit.o 
    "_mpfr_set_q", referenced from: 
     CGAL::Real_embeddable_traits<CGAL::Gmpq>::To_interval::operator()(CGAL::Gmpq const&) constin hit.o 
    "_mpfr_get_d", referenced from: 
     CGAL::Real_embeddable_traits<CGAL::Gmpq>::To_interval::operator()(CGAL::Gmpq const&) constin hit.o 
    "_mpfr_clear", referenced from: 
     CGAL::Real_embeddable_traits<CGAL::Gmpq>::To_interval::operator()(CGAL::Gmpq const&) constin hit.o 
    "___gmpq_set_d", referenced from: 
     CGAL::Gmpq::Gmpq(double)in hit.o 
    "___gmpq_cmp", referenced from: 
     CGAL::Gmpq::operator<(CGAL::Gmpq const&) constin hit.o 
    "___gmpq_sub", referenced from: 
     CGAL::Gmpq::operator-=(CGAL::Gmpq const&)in hit.o 
    "___gmpq_mul", referenced from: 
     CGAL::Gmpq::operator*=(CGAL::Gmpq const&)in hit.o 
ld: symbol(s) not found for architecture x86_64 
collect2: ld returned 1 exit status 
make: *** [Hit] Error 1 

答えて

2

CGALはファイルCGALConfig.cmakeに設定されている建物のツールとCGALを使用してプログラムを使用する必要があり、すべてのコンパイラフラグなどにcmakeを使用しています。

は、これは私がコンパイルする方法です。

少なくとも、-lCGAL -lgmp -lmpfr -lboost_threadがありません。

また、CGALConfig.cmakeファイルを調べて、必要なgccオプション(例:frounding-mathなど)を確認します。

cmakeはeclipse用のmakefileを生成できることに注意してください。

-1

Eclipseで、これは私の作品ではないが:

$ cgal_create_CMakeLists -c Core -s out 
$ cmake . 
$ make 

その後、バイナリを実行するには:

$ ./out 
関連する問題