Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Problem in compiling simple CGAL programs

Subject: CGAL users discussion list

List archive

[cgal-discuss] Problem in compiling simple CGAL programs


Chronological Thread 
  • From: anil <>
  • To:
  • Subject: [cgal-discuss] Problem in compiling simple CGAL programs
  • Date: Wed, 14 Dec 2011 03:32:24 -0800 (PST)

Hello,
I am a new CGAL user. I am trying to run this simple program using NETBEANS
but it is giving error i am not getting whether it is a CGAL configuration
problem or the program is wrong.

*
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;

int main() {
Point_2 points[5] = { Point_2(0,0), Point_2(10,0),
Point_2(10,10),Point_2(6,5),Point_2(4,1) };
std::vector<Point_2> result;
CGAL::convex_hull_2( points, points+5, std::back_inserter(result) );
std::cout << result.size() << " points on the convex hull\n";
return 0;
}
*



Error:---------------
*
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/mustang/NetBeansProjects/CHull'
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/chull
make[2]: Entering directory `/home/mustang/NetBeansProjects/CHull'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++ -ICGAL -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o
build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -ICGAL -o dist/Debug/GNU-Linux-x86/chull
build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `Gmpq_rep':
/usr/local/include/CGAL/GMP/Gmpq_type.h:50: undefined reference to
`__gmpq_init'
build/Debug/GNU-Linux-x86/main.o: In function `~Gmpq_rep':
/usr/local/include/CGAL/GMP/Gmpq_type.h:51: undefined reference to
`__gmpq_clear'
build/Debug/GNU-Linux-x86/main.o: In function `Gmpq':
/usr/local/include/CGAL/GMP/Gmpq_type.h:132: undefined reference to
`__gmpq_set_d'
/usr/local/include/CGAL/GMP/Gmpq_type.h:131: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function
`CGAL::Gmpq::operator==(CGAL::Gmpq const&) const':
/usr/local/include/CGAL/GMP/Gmpq_type.h:193: undefined reference to
`__gmpq_equal'
build/Debug/GNU-Linux-x86/main.o: In function
`CGAL::Gmpq::operator<(CGAL::Gmpq const&) const':
/usr/local/include/CGAL/GMP/Gmpq_type.h:194: undefined reference to
`__gmpq_cmp'
build/Debug/GNU-Linux-x86/main.o: In function
`CGAL::Gmpq::operator-=(CGAL::Gmpq const&)':
/usr/local/include/CGAL/GMP/Gmpq_type.h:286: undefined reference to
`__gmpq_sub'
build/Debug/GNU-Linux-x86/main.o: In function
`CGAL::Gmpq::operator*=(CGAL::Gmpq const&)':
/usr/local/include/CGAL/GMP/Gmpq_type.h:296: undefined reference to
`__gmpq_mul'
build/Debug/GNU-Linux-x86/main.o: In function `Handle':
/usr/local/include/CGAL/Handle.h:54: undefined reference to
`CGAL::precondition_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function `bool
CGAL::get_certain<bool>(CGAL::Uncertain<bool>)':
/usr/local/include/CGAL/Uncertain.h:205: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function `Uncertain':
/usr/local/include/CGAL/Uncertain.h:103: undefined reference to
`CGAL::precondition_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function `Interval_nt':
/usr/local/include/CGAL/Interval_nt.h:88: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function `Test_runtime_rounding_modes':
/usr/local/include/CGAL/Interval_nt.h:158: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
/usr/local/include/CGAL/Interval_nt.h:160: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
/usr/local/include/CGAL/Interval_nt.h:158: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
/usr/local/include/CGAL/Interval_nt.h:160: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function
`std::back_insert_iterator<std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >
CGAL::ch_akl_toussaint<CGAL::Point_2&lt;CGAL::Epick>*,
std::back_insert_iterator<std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Epick>(CGAL::Point_2<CGAL::Epick>*, CGAL::Point_2<CGAL::Epick>*,
std::back_insert_iterator<std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >, CGAL::Epick const&)':
/usr/local/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h:131: undefined
reference to `CGAL::postcondition_fail(char const*, char const*, int, char
const*)'
build/Debug/GNU-Linux-x86/main.o: In function
`CGAL::Tee_for_output_iterator<std::back_insert_iterator&lt;std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Point_2<CGAL::Epick> >
CGAL::ch__ref_graham_andrew_scan<__gnu_cxx::__normal_iterator<CGAL::Point_2&lt;CGAL::Epick>*,
std::vector<CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Tee_for_output_iterator<std::back_insert_iterator&lt;std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Point_2<CGAL::Epick> >,
CGAL::Epick>(__gnu_cxx::__normal_iterator<CGAL::Point_2&lt;CGAL::Epick>*,
std::vector<CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
__gnu_cxx::__normal_iterator<CGAL::Point_2&lt;CGAL::Epick>*,
std::vector<CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Tee_for_output_iterator<std::back_insert_iterator&lt;std::vector&lt;CGAL::Point_2&lt;CGAL::Epick>,
std::allocator<CGAL::Point_2&lt;CGAL::Epick> > > >,
CGAL::Point_2<CGAL::Epick> >&, CGAL::Epick const&)':
/usr/local/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h:146: undefined
reference to `CGAL::precondition_fail(char const*, char const*, int, char
const*)'
/usr/local/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h:147: undefined
reference to `CGAL::precondition_fail(char const*, char const*, int, char
const*)'
/usr/local/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h:150: undefined
reference to `CGAL::precondition_fail(char const*, char const*, int, char
const*)'
/usr/local/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h:180: undefined
reference to `CGAL::assertion_fail(char const*, char const*, int, char
const*)'
build/Debug/GNU-Linux-x86/main.o: In function `CGAL::Sign
CGAL::get_certain<CGAL::Sign>(CGAL::Uncertain<CGAL::Sign>)':
/usr/local/include/CGAL/Uncertain.h:205: undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
build/Debug/GNU-Linux-x86/main.o: In function `Uncertain':
/usr/local/include/CGAL/Uncertain.h:103: undefined reference to
`CGAL::precondition_fail(char const*, char const*, int, char const*)'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/chull] Error 1
make[2]: Leaving directory `/home/mustang/NetBeansProjects/CHull'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/mustang/NetBeansProjects/CHull'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 8s)

*

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Problem-in-compiling-simple-CGAL-programs-tp4194542p4194542.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page