Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure of CGAL::cross_product on Windows MSVC #8140

Closed
efifogel opened this issue Apr 11, 2024 · 3 comments · Fixed by #8175
Closed

Compilation failure of CGAL::cross_product on Windows MSVC #8140

efifogel opened this issue Apr 11, 2024 · 3 comments · Fixed by #8175
Assignees
Milestone

Comments

@efifogel
Copy link
Member

efifogel commented Apr 11, 2024

Issue Details

The simple program below fails to compile under Windows using MSVC.
It does compile with gcc (Ubuntu).
Below you can find the relevant stripped error messages.
If you remove the overload of CGAL::cross_product() in DirectionH3.h, the error goes away.
Andreas witness the error, and suggested to completely remove the overload. (The testsuite passes without it.)
In case you wonder, this breaks my Python bindings on Windows...

C:...\cgal\Homogeneous_kernel\include\CGAL\Homogeneous\DirectionH3.h(38,35): error C2062: type 'unknown-type' unexpected
C:...\cgal\Homogeneous_kernel\include\CGAL\Homogeneous\DirectionH3.h(38,58): error C2238: unexpected token(s) preceding ';'
C:...\cgal\Homogeneous_kernel\include\CGAL\Homogeneous\DirectionH3.h(40,10): error C3646: 'base': unknown override specifier

Source Code

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>

int main() { // For testing, we just print the combinations of types
  using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
  using Vec_3 = Kernel::Vector_3;
  using Cp_fnc3 = Vec_3(*)(const Vec_3&, const Vec_3&);

  Cp_fnc3 f = static_cast<Cp_fnc3>(&CGAL::cross_product<Kernel>);
  Vec_3 v1, v2;
  Vec_3 v = f(v1, v2);
  return 0;
}

Environment

  • Operating system (Windows/64 bits):
  • Compiler:
  • Release or debug mode:
  • Specific flags used (if any):
  • CGAL version: master
  • Boost version: irrelevant
  • Other libraries versions if used (Eigen, TBB, etc.):
@afabri
Copy link
Member

afabri commented Apr 19, 2024

@lrineau can we look into this on Monday. I was able to reproduce it at the CGAL Developer Meeting. We can remove the overload as it is not documented, but it would be better to understand what is going on, as there may be similar situations where overloads are justified.

@mglisse
Copy link
Member

mglisse commented Apr 21, 2024

DirectionH3.h includes Handle_for.h but uses Handle, that's suspicious, although it is far from the only file that does that.

@lrineau
Copy link
Member

lrineau commented Apr 29, 2024

@lrineau can we look into this on Monday. I was able to reproduce it at the CGAL Developer Meeting. We can remove the overload as it is not documented, but it would be better to understand what is going on, as there may be similar situations where overloads are justified.

@afabri One week later, still on our TODO list. We should put something in the agenda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants