use of undeclared identifier 'CGAL_assertion'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

use of undeclared identifier 'CGAL_assertion'

Zesen Qian
Hi list,

So I'm trying to use the undocumented remove_self_intersection()
function, here is my short program:

#include <iostream>
#include <fstream>

#include <CGAL/Surface_mesh.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polygon_mesh_processing/repair.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel T;
typedef T::Point_3 Point;
typedef CGAL::Surface_mesh<Point> Mesh;

namespace PMP = CGAL::Polygon_mesh_processing;

int main(int argc, char *argv[]) {
  std::ifstream inS(argv[1]);

  Mesh in;
  inS >> in;

  bool ret = PMP::remove_self_intersections(in);

  std::ofstream outS(argv[2]);
  outS.precision(17);
  outS << in;
  return !ret;
}

The command used to build(clang++ 6.0.0) is:

/usr/bin/c++ '-DCGAL_USE_CORE=1' -DCGAL_USE_GMP -DCGAL_USE_MPFR
-I/usr/local/include/eigen3 -isystem /usr/local/include
-I/usr/home/riaqn/doll/codes/cxx/build -O3 -DNDEBUG '-std=gnu++1z' -o
CMakeFiles/fix.dir/fix.cxx.o -c /usr/home/riaqn/doll/codes/cxx/fix.cxx

The error shown is:

In file included from /usr/home/riaqn/doll/codes/cxx/fix.cxx:4: In
file included from /usr/local/include/CGAL/Surface_mesh.h:27: In file
included from /usr/local/include/CGAL/Surface_mesh/Surface_mesh.h:46:
/usr/local/include/CGAL/property_map.h:483:5: error: use of undeclared
identifier 'CGAL_assertion' CGAL_assertion(pm.set_ptr!=NULL); ^
/usr/local/include/CGAL/boost/graph/selection.h:120:15: note: in
instantiation of member function 'CGAL::get' requested here while(
!get(is_selected,fd) ) ^
/usr/local/include/CGAL/Polygon_mesh_processing/repair.h:1447:9: note:
in instantiation of function template specialization
'CGAL::expand_face_selection, std::__1::allocator >,
CGAL::Surface_mesh >, CGAL::Boolean_property_map, std::__1::allocator
> >, CGAL::Emptyset_iterator>' requested here
expand_face_selection(cc_faces, tm, step, ^
/usr/local/include/CGAL/Polygon_mesh_processing/repair.h:1928:7: note:
in instantiation of function template specialization
'CGAL::Polygon_mesh_processing::remove_self_intersections_one_step >,
CGAL::SM_Face_index, CGAL::Surface_mesh >::Property_map > >' requested
here remove_self_intersections_one_step(tm, faces_to_remove, vpm,
step, preserve_genus, verbose); ^
/usr/local/include/CGAL/Polygon_mesh_processing/repair.h:1944:10:
note: in instantiation of function template specialization
'CGAL::Polygon_mesh_processing::remove_self_intersections >,
CGAL::cgal_bgl_named_params >' requested here return
remove_self_intersections(tm, parameters::all_default()); ^
/usr/home/riaqn/doll/codes/cxx/fix.cxx:20:19: note: in instantiation
of function template specialization
'CGAL::Polygon_mesh_processing::remove_self_intersections > >'
requested here bool ret = PMP::remove_self_intersections(in); ^

Any comment would be much appreciated.

Best,
Zesen

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: use of undeclared identifier 'CGAL_assertion'

Laurent Rineau (CGAL/GeometryFactory)
Le Wednesday, July 11, 2018 3:25:32 PM CEST Zesen Qian a écrit :

> Hi list,
>
> So I'm trying to use the undocumented remove_self_intersection()
> function, here is my short program:
>
> #include <iostream>
> #include <fstream>
>
> #include <CGAL/Surface_mesh.h>
> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
> #include <CGAL/Polygon_mesh_processing/repair.h>
>
> typedef CGAL::Exact_predicates_exact_constructions_kernel T;
> typedef T::Point_3 Point;
> typedef CGAL::Surface_mesh<Point> Mesh;
>
> namespace PMP = CGAL::Polygon_mesh_processing;
>
> int main(int argc, char *argv[]) {
>   std::ifstream inS(argv[1]);
>
>   Mesh in;
>   inS >> in;
>
>   bool ret = PMP::remove_self_intersections(in);
>
>   std::ofstream outS(argv[2]);
>   outS.precision(17);
>   outS << in;
>   return !ret;
> }
>
> The command used to build(clang++ 6.0.0) is:
>
> /usr/bin/c++ '-DCGAL_USE_CORE=1' -DCGAL_USE_GMP -DCGAL_USE_MPFR
> -I/usr/local/include/eigen3 -isystem /usr/local/include
> -I/usr/home/riaqn/doll/codes/cxx/build -O3 -DNDEBUG '-std=gnu++1z' -o
> CMakeFiles/fix.dir/fix.cxx.o -c /usr/home/riaqn/doll/codes/cxx/fix.cxx
>
> The error shown is:
>
> In file included from /usr/home/riaqn/doll/codes/cxx/fix.cxx:4: In
> file included from /usr/local/include/CGAL/Surface_mesh.h:27: In file
> included from /usr/local/include/CGAL/Surface_mesh/Surface_mesh.h:46:
> /usr/local/include/CGAL/property_map.h:483:5: error: use of undeclared
> identifier 'CGAL_assertion' CGAL_assertion(pm.set_ptr!=NULL); ^
[...]
> Any comment would be much appreciated.

Hi, there is indeed a bug in CGAL. It will be fixed in a future version of
CGAL.

As a workaround, you can add the following line:

    #include <CGAL/assertions.h>

before the include of <CGAL/Surface_mesh.h>.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: use of undeclared identifier 'CGAL_assertion'

Zesen Qian
Thank you Laurent, it works now.

On Thu, Jul 12, 2018 at 11:14 AM, Laurent Rineau
(CGAL/GeometryFactory) <[hidden email]> wrote:

> Le Wednesday, July 11, 2018 3:25:32 PM CEST Zesen Qian a écrit :
>> Hi list,
>>
>> So I'm trying to use the undocumented remove_self_intersection()
>> function, here is my short program:
>>
>> #include <iostream>
>> #include <fstream>
>>
>> #include <CGAL/Surface_mesh.h>
>> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
>> #include <CGAL/Polygon_mesh_processing/repair.h>
>>
>> typedef CGAL::Exact_predicates_exact_constructions_kernel T;
>> typedef T::Point_3 Point;
>> typedef CGAL::Surface_mesh<Point> Mesh;
>>
>> namespace PMP = CGAL::Polygon_mesh_processing;
>>
>> int main(int argc, char *argv[]) {
>>   std::ifstream inS(argv[1]);
>>
>>   Mesh in;
>>   inS >> in;
>>
>>   bool ret = PMP::remove_self_intersections(in);
>>
>>   std::ofstream outS(argv[2]);
>>   outS.precision(17);
>>   outS << in;
>>   return !ret;
>> }
>>
>> The command used to build(clang++ 6.0.0) is:
>>
>> /usr/bin/c++ '-DCGAL_USE_CORE=1' -DCGAL_USE_GMP -DCGAL_USE_MPFR
>> -I/usr/local/include/eigen3 -isystem /usr/local/include
>> -I/usr/home/riaqn/doll/codes/cxx/build -O3 -DNDEBUG '-std=gnu++1z' -o
>> CMakeFiles/fix.dir/fix.cxx.o -c /usr/home/riaqn/doll/codes/cxx/fix.cxx
>>
>> The error shown is:
>>
>> In file included from /usr/home/riaqn/doll/codes/cxx/fix.cxx:4: In
>> file included from /usr/local/include/CGAL/Surface_mesh.h:27: In file
>> included from /usr/local/include/CGAL/Surface_mesh/Surface_mesh.h:46:
>> /usr/local/include/CGAL/property_map.h:483:5: error: use of undeclared
>> identifier 'CGAL_assertion' CGAL_assertion(pm.set_ptr!=NULL); ^
> [...]
>> Any comment would be much appreciated.
>
> Hi, there is indeed a bug in CGAL. It will be fixed in a future version of
> CGAL.
>
> As a workaround, you can add the following line:
>
>     #include <CGAL/assertions.h>
>
> before the include of <CGAL/Surface_mesh.h>.
>
> --
> Laurent Rineau, PhD
> R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
> Release Manager of the CGAL Project       http://www.cgal.org/
>
>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss