Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] error in running saple code

Subject: CGAL users discussion list

List archive

[cgal-discuss] error in running saple code


Chronological Thread 
  • From: pratihast22089 <>
  • To:
  • Subject: [cgal-discuss] error in running saple code
  • Date: Fri, 23 Oct 2009 06:21:08 -0700 (PDT)


Hi ,

I am beginner and I am trying learn CGAL from Manual.
When i try to run "examples/Surface_mesher/mesh_a_3d_gray_image.cpp", i just
change the data path :

//File: examples/Surface_mesher/mesh_a_3d_gray_image.cpp
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/Surface_mesh_default_criteria_3.h>
#include <CGAL/Complex_2_in_triangulation_3.h>
#include <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>
#include <fstream>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Gray_level_image_3.h>
#include <CGAL/Implicit_surface_3.h>

// default triangulation for Surface_mesher
typedef CGAL::Surface_mesh_default_triangulation_3 Tr;

// c2t3
typedef CGAL::Complex_2_in_triangulation_3<Tr> C2t3;

typedef Tr::Geom_traits GT;
typedef CGAL::Gray_level_image_3<GT::FT, GT::Point_3> Gray_level_image;
typedef CGAL::Implicit_surface_3<GT, Gray_level_image> Surface_3;

int main() {
Tr tr; // 3D-Delaunay triangulation
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation

// the 'function' is a 3D gray level image
Gray_level_image image("D:/Cgalcode/ex1/data/skull_2.9.inr", 2.9);

// Carefully choosen bounding sphere: the center must be inside the
// surface defined by 'image' and the radius must be high enough so that
// the sphere actually bounds the whole image.
GT::Point_3 bounding_sphere_center(122., 102., 117.);
GT::FT bounding_sphere_squared_radius = 200.*200.*2.;
GT::Sphere_3 bounding_sphere(bounding_sphere_center,
bounding_sphere_squared_radius);

// definition of the surface, with 10^-5 as relative precision
Surface_3 surface(image, bounding_sphere, 1e-5);

// defining meshing criteria
CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.,
5.,
5.);

// meshing surface, with the "manifold without boundary" algorithm
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag());
std::ofstream out("D:/Cgalcode/ex1/data/out.off");
CGAL::output_surface_facets_to_off (out, c2t3);
std::cout << "Final number of points: " << tr.number_of_vertices() <<
"\n";
}

when i build inj visual c++ 2008 , it gives the following linking error:

Compiling...
stdafx.cpp
Compiling...
ex1.cpp
d:\cgalcode\ex1\ex1\ex1.cpp(30) : warning C4305: 'argument' : truncation
from 'double' to 'float'
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.

Linking...
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glEnd@0
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw(float,unsigned char,unsigned char,unsigned
char)"
(?gl_draw@Image_3@CGAL@@QAEXMEEE@Z)
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glVertex3d@24
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw(float,unsigned char,unsigned char,unsigned
char)"
(?gl_draw@Image_3@CGAL@@QAEXMEEE@Z)
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glBegin@4
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw(float,unsigned char,unsigned char,unsigned
char)"
(?gl_draw@Image_3@CGAL@@QAEXMEEE@Z)
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glColor3ub@12
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw(float,unsigned char,unsigned char,unsigned
char)"
(?gl_draw@Image_3@CGAL@@QAEXMEEE@Z)
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glPointSize@4
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw(float,unsigned char,unsigned char,unsigned
char)"
(?gl_draw@Image_3@CGAL@@QAEXMEEE@Z)
CGAL_ImageIO-vc90-mt-gd.lib(all_files.obj) : error LNK2019: unresolved
external symbol
__imp__glLineWidth@4
referenced in function "public: void
__thiscall CGAL::Image_3::gl_draw_bbox(float,unsigned char,unsigned
char,unsigned char)"
(?gl_draw_bbox@Image_3@CGAL@@QAEXMEEE@Z)
D:\Cgalcode\ex1\Debug\ex1.exe : fatal error LNK1120: 6 unresolved externals
Results Build log was saved at
"file://d:\Cgalcode\ex1\ex1\Debug\BuildLog.htm"
ex1 - 7 error(s), 1 warning(s)

Could you please help me in this situation?
Thank you in advance.

Regards,
Arun K Pratihast
ITC, Netherland

--
View this message in context:
http://www.nabble.com/error-in-running-saple-code-tp26026341p26026341.html
Sent from the cgal-discuss mailing list archive at Nabble.com.




Archive powered by MHonArc 2.6.16.

Top of Page