Skip to Content.
Sympa Menu

cgal-discuss - Tutorial problem

Subject: CGAL users discussion list

List archive

Tutorial problem


Chronological Thread 
  • From: BomBielFil <>
  • To:
  • Subject: Tutorial problem
  • Date: Fri, 18 Jan 2008 18:16:31 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=J3K7pzNzgE0ZPV2D3nTtltk/RvTnpfZhMjANVG+Kx9c9mGAKV2+PeHaJcFgLpGG0qVuwLS2zqvoL2QhJqzJy20yuwBqkirG8a1OUaD4EBkOMoJ9zutUlnxlbC6KyM3MdcqQPhusbirSppifm12Sqs6BNFwQ7iQ9pZuoF6de9wLk=

Hi,
I'm a new user of CGAL and I just tried some simple example but I've problem when I compile whit g++ command.
I compile whit success in Linux the follow code:

#include "tutorial.h"
#include <CGAL/Point_2.h>
#include <CGAL/Vector_2.h>
#include <iostream>
main()
 {
 Point p1(1.0, -1.0), p2(4.0, 3.0), p3;
 Vector v1(-1, 10);
 Vector v2(p2-p1);
 v1 = v1 + v2;
 p3 = p2 + v1*2;
 std::cout << "Vector v2 has coordinates: ("
 << v2.x() <<", "<<v2.y() <<")\n";
 std::cout << "Point p3 has coordinates: ("
 << p3.x() <<", "<<p3.y() <<")\n";
 }

whit "g++ <filename>.cpp -o <filename>"
but if I compile whit the same command:
#include "tutorial.h"
#include <CGAL/intersections.h>
int main() {
  Point_2< Cartesian<double> > p1(0,0) , p2(10,10), p3(4,6) , p4(10,0);
  Segment_2<Cartesian<double> > s1(p1,p2), s2(p3,p4);
  if (do_intersect(s1,s2)) {
    Point_2<Cartesian<double> > temp;
    Object ob;
    ob = intersection(s1,s2);
    
    if (assign(temp,ob)) {
      cout << "the intersection is a point  "<< temp;
    }
  }
}
 
the reply is:
"triang.cpp:(.text. ZNK4CGL4Tds2INS_3TvbINS_5Etxy3INS_9CartesianIdEEEENS_5TdsvbIvEEEENS_3TfbISS_NS_5TdsfbIvEEEE11file_outputERSonNS...
etc.........etc....
collect2: ld returned 1 exit status"
What kind of errors it is??
 Best regards
-Bombielfil-



Archive powered by MHonArc 2.6.16.

Top of Page