From e100cf5a345b18321f5a6d836a3afd3110a08e4f Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 14 Aug 2026 17:38:47 +0500 Subject: [PATCH] Fix examples linking errors for shared build (incorrect attributes order) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E.g. IfcAdvancedHouse: ``` /usr/bin/x86_64-linux-gnu-ld.bfd: CMakeFiles/IfcAdvancedHouse.dir/IfcAdvancedHouse.cpp.o: in function `main': IfcAdvancedHouse.cpp:(.text.startup.main+0x137): undefined reference to `hierarchy_helper::addBuilding(Ifc4x3_add2::IfcSite, Ifc4x3_add2::IfcOwnerHistory)' /usr/bin/x86_64-linux-gnu-ld.bfd: IfcAdvancedHouse.cpp:(.text.startup.main+0x7c7): undefined reference to `hierarchy_helper::getRepresentationContext(std::__cxx11::basic_string, std::allocator > const&)' /usr/bin/x86_64-linux-gnu-ld.bfd: IfcAdvancedHouse.cpp:(.text.startup.main+0x931): undefined reference to `hierarchy_helper::getRepresentationContext(std::__cxx11::basic_string, std::allocator > const&)' ``` Noticed by addressing gcc warning gcc warning that attribute order is incorrect: ``` //src/ifcparse/hierarchy_helper.i:721:31: warning: attribute ignored in explicit instantiation ‘class hierarchy_helper’ [-Wattributes] 721 | template IFC_SCHEMA_API class hierarchy_helper; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ //src/ifcparse/hierarchy_helper.i:721:31: note: no attribute can be applied to an explicit instantiation ``` --- src/ifcparse/hierarchy_helper.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcparse/hierarchy_helper.i b/src/ifcparse/hierarchy_helper.i index c6ba3b2b92..245033ec5b 100644 --- a/src/ifcparse/hierarchy_helper.i +++ b/src/ifcparse/hierarchy_helper.i @@ -718,7 +718,7 @@ typename Schema::IfcGeometricRepresentationSubContext hierarchy_helper:: return rep_subcontext; } -template IFC_SCHEMA_API class hierarchy_helper; +template class IFC_SCHEMA_API hierarchy_helper; template IFC_SCHEMA_API ifcopenshell::hierarchy_detail::surface_style_type addStyleAssignment(hierarchy_helper&, double, double, double, double);