Linking IfcGeom statically #4628
Replies: 1 comment 2 replies
-
The gcc linker does a single pass over all the static libraries. So you will need to strategically wrap the libraries in a start-group end-group, or repeat ad nauseam. See https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/cmake/CMakeLists.txt#L466-L472 and https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/cmake/CMakeLists.txt#L870 for inspiration. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
I want to link the libIfcGeom.a statically but I always get undefined symbol of various functions:
Example:
symbol lookup error: /tmp/lib1186434272717888199.tmp: undefined symbol: _ZN7IfcGeom4util18wire_intersectionsERK11TopoDS_WireR16NCollection_ListI12TopoDS_ShapeERKNS0_23wire_tolerance_settingsE
(demangled:
IfcGeom::util::wire_intersections(TopoDS_Wire const&, NCollection_List<TopoDS_Shape>&, IfcGeom::util::wire_tolerance_settings const&)
)The way I've compiled it is with this CMake file: https://github.com/OpenBimRL/OpenBimRL-Engine-Native/blob/testing/CMakeLists.txt
There is a working version when IfcGeom is a shared lib but that requires me to install IfcGeom on every target instead of shipping it with a single file (and compiling IfcGeom is a pain. Takes about 10 - 15 mins on my machine).
Also when I try the linker flags -Wl and --no-undefined I can't even link it because there are countless undefined reference errors.
Would very appreciate your input.
Beta Was this translation helpful? Give feedback.
All reactions