Zulip Chat Archive

Stream: general

Topic: FFI C++ Opencascade


Conor Bergin (Mar 27 2024 at 01:33):

I'm trying to get bindings to OCCT working (an old and large C++ CAD kernel) I'm finding I can't build a minimal project if certain headers are included in my ffi.cpp, the error is undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE.

ffi.cpp

https://github.com/Open-Cascade-SAS/OCCT/blob/master/src/StlAPI/StlAPI_Writer.hxx
https://github.com/Open-Cascade-SAS/OCCT/blob/master/src/BRepMesh/BRepMesh_IncrementalMesh.hxx
https://github.com/Open-Cascade-SAS/OCCT/blob/master/src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx

lakefile.lean

Looking through the offending headers, apart from the fact one throws an exception, I can't see why some will build and some won't?

Conor Bergin (Mar 27 2024 at 14:11):

I am also getting this problem with a header only json library which uses modern c++ features, do I need to wrap everything in a c interface before I start linking it to lean?

Conor Bergin (Mar 27 2024 at 14:27):

the json lib is producing undefined symbol: __gxx_personality_v0, which something to do with exceptions.

Full output

Sebastian Ullrich (Mar 27 2024 at 16:22):

The general suggestion in these cases is to link in the foreign parts dynamically so as to avoid any conflicts with Lean's own copy of the C++ stdlib. There are some older threads about this approach.


Last updated: May 02 2025 at 03:31 UTC