Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] about using qt3 to dislay a triangulation generated

Subject: CGAL users discussion list

List archive

[cgal-discuss] about using qt3 to dislay a triangulation generated


Chronological Thread 
  • From: Kwok Jasper <>
  • To: <>
  • Subject: [cgal-discuss] about using qt3 to dislay a triangulation generated
  • Date: Sun, 21 Dec 2008 00:46:32 +0800
  • Importance: Normal

Excuse me, may I ask something about using Qt3.2.1 Non-commercial with CGAL?
 
I have installed Qt3.2.1 non-commercial and CGAL
then, when I tried to complie the code in Miscosoft Visual C++ 2005, I get the following error

error LNK2019: 無法解析的外部符號 "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" () 在函式 _main 中被參考 tr.obj 
 
I am using the code below which is from the official web site of CGAL. May I ask what can I do to deal with the above error?
 
Thank you very much.
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/IO/Qt_widget_Delaunay_triangulation_2.h>
#include <CGAL/IO/Qt_widget.h>
#include <CGAL/IO/Qt_widget_layer.h>
#include <qapplication.h>

typedef CGAL::Cartesian<double>             Rep;
typedef CGAL::Point_2<Rep>                  Point;
typedef CGAL::Delaunay_triangulation_2<Rep> Delaunay;

Delaunay dt;

class My_layer : public CGAL::Qt_widget_layer{
  void draw(){
    *widget << dt;
  }
};

class My_window : public CGAL::Qt_widget {
public:
  My_window(int x, int y)
  {
    resize(x,y);
    attach(&layer);
  };
private:
  //this method is called when the user presses the mouse
  void mousePressEvent(QMouseEvent *e)
  {
    Qt_widget::mousePressEvent(e);
    dt.insert(Point(x_real(e->x()), y_real(e->y())));
    redraw();
  }
  My_layer layer;
};

int main( int argc, char **argv )
{
    QApplication app( argc, argv );
    My_window *W = new My_window(400,400);
    app.setMainWidget(W);
    W->show();
    W->set_window(0, 400, 0, 400);
    return app.exec();
}

 


想同MSN Buddy傾計了解佢多d? 參觀MSN Buddy部屋啦!



Archive powered by MHonArc 2.6.16.

Top of Page