use CGAL and openCASCADE at the same time, compile error?

I want to use CGAL and openCASCADE at the same time
but when I compile the project

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

I think this is because:

openCASCADE define the macro:
# define Handle(ClassName) Handle_##ClassName

while CGAL define a class with the same name

class Handle
{
public:
Handle()
: PTR(static_cast(0)) {}

....

protected:
Rep* PTR;
};

how can solve the problem

jelle's picture

Its a good idea to couple the merits of these libs, curious to know what you're working on...
I've managed to do so with pythonocc and the cgal python wrappers.

Liang Quan's picture

I want to develop CAM software, collision and interference detection, using configuration space

Alireza Norouzzadeh's picture

How can i solve this problem? I get the same compile error.

Giovanni Bettega's picture
#ifndef OCCHANDLE_H
#define OCCHANDLE_H
#include <Standard_Handle.hxx>

#define occHandle(Class) opencascade::handle<Class>

#endif // OCCHANDLE_H

use occHandle(...) instead of Handlle(...) (which is defined in Standard_Handlle.hxx>

Then in CGAL file Handle.h use

#undef Handle

This works for me. Hope this will help, even if the post is very old.

Giovanni

Alexey's picture

Hello.

I use both libraries.

You can try reorder occ and cgal #include directives, but I hide cgal using with wrapper class and pImpl idiom. This technique also help to improve compilation speed of program with cgal headers.  

BR.