From fd1f6381c11517043d44b5bceabad5bfbb46c75f Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:01 +0100 Subject: [PATCH 01/10] Templated classes and functions, inline functions and internal classes/structs should not be decorated with export. --- common/include/pcl/common/intersections.h | 4 +-- common/include/pcl/console/print.h | 28 +++++++++---------- .../include/pcl/gpu/containers/device_array.h | 4 +-- io/include/pcl/io/file_grabber.h | 2 +- ml/include/pcl/ml/dt/decision_forest.h | 2 +- ml/include/pcl/ml/dt/decision_tree.h | 2 +- .../pcl/recognition/implicit_shape_model.h | 10 +++---- .../pcl/recognition/linemod/line_rgbd.h | 2 +- .../recognition/ransac_based/simple_octree.h | 2 +- .../correspondence_rejection_poly.h | 2 +- .../pcl/sample_consensus/sac_model_plane.h | 2 +- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/common/include/pcl/common/intersections.h b/common/include/pcl/common/intersections.h index 687a69d0a12..ec1e36a1b2e 100644 --- a/common/include/pcl/common/intersections.h +++ b/common/include/pcl/common/intersections.h @@ -57,7 +57,7 @@ namespace pcl * \param[in] sqr_eps maximum allowable squared distance to the true solution * \ingroup common */ - PCL_EXPORTS inline bool + inline bool lineWithLineIntersection (const Eigen::VectorXf &line_a, const Eigen::VectorXf &line_b, Eigen::Vector4f &point, @@ -71,7 +71,7 @@ namespace pcl * \ingroup common */ - PCL_EXPORTS inline bool + inline bool lineWithLineIntersection (const pcl::ModelCoefficients &line_a, const pcl::ModelCoefficients &line_b, Eigen::Vector4f &point, diff --git a/common/include/pcl/console/print.h b/common/include/pcl/console/print.h index 8bad2c91e61..f7828526b28 100644 --- a/common/include/pcl/console/print.h +++ b/common/include/pcl/console/print.h @@ -288,7 +288,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_info(FILE* stream, const std::string format, Args&&... args) { print(L_INFO, stream, format, std::forward(args)...); @@ -298,7 +298,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_info(const std::string format, Args&&... args) { print_info(stdout, format, std::forward(args)...); @@ -309,7 +309,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_error(FILE* stream, const std::string format, Args&&... args) { print(L_ERROR, stream, format, std::forward(args)...); @@ -319,7 +319,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_error(std::string format, Args&&... args) { print_error(stderr, format, std::forward(args)...); @@ -330,7 +330,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_warn(FILE* stream, const std::string format, Args&&... args) { print(L_WARN, stream, format, std::forward(args)...); @@ -340,7 +340,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_warn(std::string format, Args&&... args) { print_warn(stderr, format, std::forward(args)...); @@ -351,7 +351,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_debug(FILE* stream, const std::string format, Args&&... args) { print(L_DEBUG, stream, format, std::forward(args)...); @@ -361,7 +361,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_debug(const std::string format, Args&&... args) { print_debug(stdout, format, std::forward(args)...); @@ -374,7 +374,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_color(FILE* stream, int attr, int fg, const std::string format, Args&&... args) { const auto str = to_string(format, std::forward(args)...); @@ -387,7 +387,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_value(FILE* stream, const std::string format, Args&&... args) { const auto str = to_string(format, std::forward(args)...); @@ -399,7 +399,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_value(const std::string format, Args&&... args) { print_value(stdout, format, std::forward(args)...); @@ -411,7 +411,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print(VERBOSITY_LEVEL level, FILE* stream, const std::string format, Args&&...args) { if (!pcl::console::isVerbosityLevelEnabled(level)) @@ -445,7 +445,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_highlight(FILE* stream, const std::string format, Args... args) { const auto str = to_string(format, std::forward(args)...); @@ -458,7 +458,7 @@ namespace pcl * \param format the message */ template - PCL_EXPORTS void + void print_highlight(const std::string format, Args&&...args) { print_highlight(stdout, format, std::forward(args)...); diff --git a/gpu/containers/include/pcl/gpu/containers/device_array.h b/gpu/containers/include/pcl/gpu/containers/device_array.h index 2930172ee9a..e65acf2a898 100644 --- a/gpu/containers/include/pcl/gpu/containers/device_array.h +++ b/gpu/containers/include/pcl/gpu/containers/device_array.h @@ -51,7 +51,7 @@ namespace gpu { * \author Anatoly Baksheev */ template -class PCL_EXPORTS DeviceArray : public DeviceMemory { +class DeviceArray : public DeviceMemory { public: /** \brief Element type. */ using type = T; @@ -185,7 +185,7 @@ class PCL_EXPORTS DeviceArray : public DeviceMemory { * \author Anatoly Baksheev */ template -class PCL_EXPORTS DeviceArray2D : public DeviceMemory2D { +class DeviceArray2D : public DeviceMemory2D { public: /** \brief Element type. */ using type = T; diff --git a/io/include/pcl/io/file_grabber.h b/io/include/pcl/io/file_grabber.h index 0f0c378bf68..680f2a3a6c5 100644 --- a/io/include/pcl/io/file_grabber.h +++ b/io/include/pcl/io/file_grabber.h @@ -50,7 +50,7 @@ namespace pcl * \ingroup io */ template - class PCL_EXPORTS FileGrabber + class FileGrabber { public: diff --git a/ml/include/pcl/ml/dt/decision_forest.h b/ml/include/pcl/ml/dt/decision_forest.h index 861c05e424b..cc1262f2970 100644 --- a/ml/include/pcl/ml/dt/decision_forest.h +++ b/ml/include/pcl/ml/dt/decision_forest.h @@ -47,7 +47,7 @@ namespace pcl { /** Class representing a decision forest. */ template -class PCL_EXPORTS DecisionForest : public std::vector> { +class DecisionForest : public std::vector> { public: /** Constructor. */ diff --git a/ml/include/pcl/ml/dt/decision_tree.h b/ml/include/pcl/ml/dt/decision_tree.h index 6ac38baab58..2c4239e9487 100644 --- a/ml/include/pcl/ml/dt/decision_tree.h +++ b/ml/include/pcl/ml/dt/decision_tree.h @@ -46,7 +46,7 @@ namespace pcl { /** Class representing a decision tree. */ template -class PCL_EXPORTS DecisionTree { +class DecisionTree { public: /** Constructor. */ DecisionTree() : root_() {} diff --git a/recognition/include/pcl/recognition/implicit_shape_model.h b/recognition/include/pcl/recognition/implicit_shape_model.h index ea02007e1f5..1fd235c12b5 100644 --- a/recognition/include/pcl/recognition/implicit_shape_model.h +++ b/recognition/include/pcl/recognition/implicit_shape_model.h @@ -67,7 +67,7 @@ namespace pcl /** \brief This class is used for storing, analyzing and manipulating votes * obtained from ISM algorithm. */ template - class PCL_EXPORTS ISMVoteList + class ISMVoteList { public: @@ -238,7 +238,7 @@ namespace pcl * \ingroup recognition */ template - class PCL_EXPORTS ImplicitShapeModelEstimation + class ImplicitShapeModelEstimation { public: @@ -249,7 +249,7 @@ namespace pcl protected: /** \brief This structure stores the information about the keypoint. */ - struct PCL_EXPORTS LocationInfo + struct LocationInfo { /** \brief Location info constructor. * \param[in] model_num number of training model. @@ -278,7 +278,7 @@ namespace pcl /** \brief This structure is used for determining the end of the * k-means clustering process. */ - struct PCL_EXPORTS TermCriteria + struct TermCriteria { enum { @@ -312,7 +312,7 @@ namespace pcl }; /** \brief Structure for storing the visual word. */ - struct PCL_EXPORTS VisualWordStat + struct VisualWordStat { /** \brief Empty constructor with member variables initialization. */ VisualWordStat () : diff --git a/recognition/include/pcl/recognition/linemod/line_rgbd.h b/recognition/include/pcl/recognition/linemod/line_rgbd.h index b955f38554f..a65b34fa515 100644 --- a/recognition/include/pcl/recognition/linemod/line_rgbd.h +++ b/recognition/include/pcl/recognition/linemod/line_rgbd.h @@ -70,7 +70,7 @@ namespace pcl * \ingroup recognition */ template - class PCL_EXPORTS LineRGBD + class LineRGBD { public: diff --git a/recognition/include/pcl/recognition/ransac_based/simple_octree.h b/recognition/include/pcl/recognition/ransac_based/simple_octree.h index fde0ff0e76e..ea792e8eb8c 100644 --- a/recognition/include/pcl/recognition/ransac_based/simple_octree.h +++ b/recognition/include/pcl/recognition/ransac_based/simple_octree.h @@ -55,7 +55,7 @@ namespace pcl namespace recognition { template - class PCL_EXPORTS SimpleOctree + class SimpleOctree { public: class Node diff --git a/registration/include/pcl/registration/correspondence_rejection_poly.h b/registration/include/pcl/registration/correspondence_rejection_poly.h index 16ad6ca841b..51a6dd269c1 100644 --- a/registration/include/pcl/registration/correspondence_rejection_poly.h +++ b/registration/include/pcl/registration/correspondence_rejection_poly.h @@ -60,7 +60,7 @@ namespace registration { * \ingroup registration */ template -class PCL_EXPORTS CorrespondenceRejectorPoly : public CorrespondenceRejector { +class CorrespondenceRejectorPoly : public CorrespondenceRejector { using CorrespondenceRejector::getClassName; using CorrespondenceRejector::input_correspondences_; using CorrespondenceRejector::rejection_name_; diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_plane.h b/sample_consensus/include/pcl/sample_consensus/sac_model_plane.h index 2f81614c9c5..3c0f34ff66e 100644 --- a/sample_consensus/include/pcl/sample_consensus/sac_model_plane.h +++ b/sample_consensus/include/pcl/sample_consensus/sac_model_plane.h @@ -139,7 +139,7 @@ namespace pcl * \ingroup sample_consensus */ template - class PCL_EXPORTS SampleConsensusModelPlane : public SampleConsensusModel + class SampleConsensusModelPlane : public SampleConsensusModel { public: using SampleConsensusModel::model_name_; From dd953a140f53c700dd36ac799237632cb0414db5 Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:11 +0100 Subject: [PATCH 02/10] Properly set OpenNurbs to export on windows. Remove PCL_EXPORTS as it created dublicated export prefixes. --- surface/CMakeLists.txt | 5 ++++- .../3rdparty/opennurbs/opennurbs_defines.h | 4 +--- .../3rdparty/opennurbs/opennurbs_error.h | 2 +- .../3rdparty/opennurbs/opennurbs_extensions.h | 10 ++++------ .../3rdparty/opennurbs/opennurbs_nurbscurve.h | 4 +--- .../opennurbs/opennurbs_nurbssurface.h | 10 ++++------ .../3rdparty/opennurbs/opennurbs_point.h | 20 +++++++++---------- .../3rdparty/opennurbs/opennurbs_string.h | 4 +--- .../3rdparty/opennurbs/opennurbs_surface.h | 4 +--- .../3rdparty/opennurbs/opennurbs_textlog.h | 4 +--- 10 files changed, 27 insertions(+), 40 deletions(-) diff --git a/surface/CMakeLists.txt b/surface/CMakeLists.txt index 7c5f7dd52b3..8c9fa596ded 100644 --- a/surface/CMakeLists.txt +++ b/surface/CMakeLists.txt @@ -167,9 +167,12 @@ set(impl_incs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs} ${VTK_SMOOTHING_INCLUDES} ${POISSON_INCLUDES} ${OPENNURBS_INCLUDES} ${ON_NURBS_INCLUDES}) - target_link_libraries("${LIB_NAME}" pcl_common pcl_search pcl_kdtree pcl_octree ${ON_NURBS_LIBRARIES}) +if(PCL_LIB_TYPE STREQUAL "SHARED") + target_compile_definitions(${LIB_NAME} PRIVATE "OPENNURBS_EXPORTS") +endif() + if(VTK_FOUND) if(${VTK_VERSION} VERSION_GREATER_EQUAL 9.0) target_link_libraries("${LIB_NAME}" diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h index 8da7643e7c7..7ce1b12e15d 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h @@ -23,8 +23,6 @@ #if !defined(OPENNURBS_DEFINES_INC_) #define OPENNURBS_DEFINES_INC_ -#include - #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus) || defined(ON_CPLUSPLUS) // C++ extern "C" declaration for C linkage @@ -359,7 +357,7 @@ union ON_U #if defined(ON_CPLUSPLUS) // OpenNurbs enums -class PCL_EXPORTS ON_CLASS ON +class ON_CLASS ON { public: /* diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_error.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_error.h index e12d044e9ab..80b2deb782f 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_error.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_error.h @@ -86,7 +86,7 @@ void ON_Error( const char*, /* sFileName: __FILE__ will do fine */ ... /* printf() style ags */ ); -PCL_EXPORTS ON_DECL +ON_DECL void ON_ErrorEx( const char*, // sFileName: __FILE__ will do fine int, // line number: __LINE__ will do fine const char*, // sFunctionName: __FUNCTION__ will do fine diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_extensions.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_extensions.h index aa945fd8fb6..74a92e7d391 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_extensions.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_extensions.h @@ -18,13 +18,11 @@ #if !defined(OPENNURBS_EXTENSIONS_INC_) #define OPENNURBS_EXTENSIONS_INC_ -#include - /* Description: Used to store user data information in an ONX_Model. */ -class PCL_EXPORTS ON_CLASS ONX_Model_UserData +class ON_CLASS ONX_Model_UserData { public: #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS) @@ -66,7 +64,7 @@ class PCL_EXPORTS ON_CLASS ONX_Model_UserData Description: Used to store geometry table object definition and attributes in an ONX_Model. */ -class PCL_EXPORTS ON_CLASS ONX_Model_Object +class ON_CLASS ONX_Model_Object { public: #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS) @@ -108,7 +106,7 @@ class PCL_EXPORTS ON_CLASS ONX_Model_Object Description: Used to store render light table light definition and attributes in an ONX_Model. */ -class PCL_EXPORTS ON_CLASS ONX_Model_RenderLight +class ON_CLASS ONX_Model_RenderLight { public: #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS) @@ -174,7 +172,7 @@ ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray; read from 3dm archives. Please study example_read.cpp for details. */ -class PCL_EXPORTS ON_CLASS ONX_Model +class ON_CLASS ONX_Model { public: #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS) diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbscurve.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbscurve.h index e5a1dd04c00..5a5e5cfef14 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbscurve.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbscurve.h @@ -23,10 +23,8 @@ #if !defined(OPENNURBS_NURBSCURVE_INC_) #define OPENNURBS_NURBSCURVE_INC_ -#include - class ON_NurbsCurve; -class PCL_EXPORTS ON_CLASS ON_NurbsCurve : public ON_Curve +class ON_CLASS ON_NurbsCurve : public ON_Curve { ON_OBJECT_DECLARE(ON_NurbsCurve); diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbssurface.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbssurface.h index 630fbd2d80d..b2545320c12 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbssurface.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_nurbssurface.h @@ -23,8 +23,6 @@ #if !defined(OPENNURBS_NURBSSURFACE_INC_) #define OPENNURBS_NURBSSURFACE_INC_ -#include - class ON_CLASS ON_TensorProduct { // Pure virtual tensor passed to ON_NurbsSurface::TensorProduct() @@ -61,7 +59,7 @@ class ON_CLASS ON_TensorProduct class ON_Brep; class ON_NurbsSurface; -class PCL_EXPORTS ON_CLASS ON_NurbsSurface : public ON_Surface +class ON_CLASS ON_NurbsSurface : public ON_Surface { ON_OBJECT_DECLARE(ON_NurbsSurface); @@ -1025,7 +1023,7 @@ class PCL_EXPORTS ON_CLASS ON_NurbsSurface : public ON_Surface }; -class PCL_EXPORTS ON_CLASS ON_NurbsCage : public ON_Geometry +class ON_CLASS ON_NurbsCage : public ON_Geometry { ON_OBJECT_DECLARE(ON_NurbsCage); @@ -1733,7 +1731,7 @@ bool ON_GetCageXform( ); -class PCL_EXPORTS ON_CLASS ON_MorphControl : public ON_Geometry +class ON_CLASS ON_MorphControl : public ON_Geometry { ON_OBJECT_DECLARE(ON_MorphControl); @@ -1928,7 +1926,7 @@ class PCL_EXPORTS ON_CLASS ON_MorphControl : public ON_Geometry }; -class PCL_EXPORTS ON_CLASS ON_CageMorph : public ON_SpaceMorph +class ON_CLASS ON_CageMorph : public ON_SpaceMorph { public: ON_CageMorph(); diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_point.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_point.h index ecb0adf64db..2c265d16702 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_point.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_point.h @@ -22,8 +22,6 @@ #if !defined(ON_POINT_INC_) #define ON_POINT_INC_ -#include - class ON_BoundingBox; class ON_Xform; class ON_Line; @@ -45,7 +43,7 @@ class ON_Interval; // // ON_Interval // -class PCL_EXPORTS ON_CLASS ON_Interval +class ON_CLASS ON_Interval { public: @@ -263,7 +261,7 @@ class PCL_EXPORTS ON_CLASS ON_Interval // // ON_2dPoint // -class PCL_EXPORTS ON_CLASS ON_2dPoint +class ON_CLASS ON_2dPoint { public: double x, y; @@ -415,7 +413,7 @@ ON_2dPoint operator*(double, const ON_2dPoint&); // // ON_3dPoint // -class PCL_EXPORTS ON_CLASS ON_3dPoint +class ON_CLASS ON_3dPoint { public: double x, y, z; @@ -569,7 +567,7 @@ ON_3dPoint operator*(double, const ON_3dPoint&); // // ON_4dPoint (homogeneous coordinates) // -class PCL_EXPORTS ON_CLASS ON_4dPoint +class ON_CLASS ON_4dPoint { public: double x, y, z, w; @@ -671,7 +669,7 @@ ON_4dPoint operator*(double, const ON_4dPoint&); // // ON_2dVector // -class PCL_EXPORTS ON_CLASS ON_2dVector +class ON_CLASS ON_2dVector { public: double x, y; @@ -949,7 +947,7 @@ ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed // // ON_3dVector // -class PCL_EXPORTS ON_CLASS ON_3dVector +class ON_CLASS ON_3dVector { public: double x, y, z; @@ -1174,7 +1172,7 @@ class PCL_EXPORTS ON_CLASS ON_3dVector ); }; -class PCL_EXPORTS ON_CLASS ON_3dRay +class ON_CLASS ON_3dRay { public: ON_3dRay(); @@ -1189,7 +1187,7 @@ class PCL_EXPORTS ON_CLASS ON_3dRay Typically the vector portion is a unit vector and m_d = -(x*P.x + y*P.y + z*P.z) for a point P on the plane. */ -class PCL_EXPORTS ON_CLASS ON_PlaneEquation : public ON_3dVector +class ON_CLASS ON_PlaneEquation : public ON_3dVector { public: // C++ defaults for construction, destruction, copys, and operator= @@ -1576,7 +1574,7 @@ extern ON_EXTERN_DECL const ON_3dVector ON_zaxis; // (0.0, 0.0, 1.0) // // ON_SurfaceCurvature // -class PCL_EXPORTS ON_CLASS ON_SurfaceCurvature +class ON_CLASS ON_SurfaceCurvature { public: double k1, k2; // principal curvatures diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_string.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_string.h index dc537826fec..f74d565728c 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_string.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_string.h @@ -17,8 +17,6 @@ #if !defined(ON_STRING_INC_) #define ON_STRING_INC_ -#include - /* Description: Sort an index array. @@ -697,7 +695,7 @@ class ON_CLASS ON_String // ON_wString // -class PCL_EXPORTS ON_CLASS ON_wString +class ON_CLASS ON_wString { public: diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_surface.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_surface.h index 5278a230073..87d1ad5d69c 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_surface.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_surface.h @@ -23,8 +23,6 @@ #if !defined(OPENNURBS_SURFACE_INC_) #define OPENNURBS_SURFACE_INC_ -#include - class ON_Curve; class ON_NurbsSurface; class ON_SurfaceTree; @@ -41,7 +39,7 @@ class ON_PolyCurve; class ON_CurveProxy; class ON_Surface; -class PCL_EXPORTS ON_CLASS ON_Surface : public ON_Geometry +class ON_CLASS ON_Surface : public ON_Geometry { ON_OBJECT_DECLARE(ON_Surface); diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_textlog.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_textlog.h index aa2cb9e8193..ebd83da4dea 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_textlog.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_textlog.h @@ -17,9 +17,7 @@ #if !defined(ON_TEXTLOG_INC_) #define ON_TEXTLOG_INC_ -#include - -class PCL_EXPORTS ON_CLASS ON_TextLog +class ON_CLASS ON_TextLog { public: /* From f5379f8aec9ddb9bd1eac5e03cf00eef688d40fa Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:20 +0100 Subject: [PATCH 03/10] Add missing exports. --- .../pcl/apps/cloud_composer/commands.h | 13 ++- .../items/cloud_composer_item.h | 3 +- .../apps/cloud_composer/items/cloud_item.h | 3 +- .../pcl/apps/cloud_composer/items/fpfh_item.h | 3 +- .../apps/cloud_composer/items/normals_item.h | 2 +- .../point_selectors/interactor_style_switch.h | 2 +- .../point_selectors/selection_event.h | 2 +- .../apps/cloud_composer/properties_model.h | 4 +- .../tool_interface/abstract_tool.h | 11 +- common/include/pcl/impl/point_types.hpp | 108 +++++++++--------- .../surface/on_nurbs/fitting_surface_tdm.h | 2 +- 11 files changed, 80 insertions(+), 73 deletions(-) diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/commands.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/commands.h index 9ef05cde3e8..d5d50a3eff6 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/commands.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/commands.h @@ -38,6 +38,7 @@ #pragma once #include +#include #include @@ -50,7 +51,7 @@ struct OutputPair { QList output_items_; }; -class CloudCommand : public QUndoCommand { +class PCL_EXPORTS CloudCommand : public QUndoCommand { public: CloudCommand(ConstItemList input_data, QUndoCommand* parent = nullptr); @@ -116,7 +117,7 @@ class CloudCommand : public QUndoCommand { int template_type_{-1}; }; -class ModifyItemCommand : public CloudCommand { +class PCL_EXPORTS ModifyItemCommand : public CloudCommand { public: ModifyItemCommand(ConstItemList input_data, QUndoCommand* parent = nullptr); @@ -132,7 +133,7 @@ class ModifyItemCommand : public CloudCommand { private: }; -class NewItemCloudCommand : public CloudCommand { +class PCL_EXPORTS NewItemCloudCommand : public CloudCommand { public: NewItemCloudCommand(ConstItemList input_data, QUndoCommand* parent = nullptr); @@ -146,7 +147,7 @@ class NewItemCloudCommand : public CloudCommand { redo() override; }; -class SplitCloudCommand : public CloudCommand { +class PCL_EXPORTS SplitCloudCommand : public CloudCommand { public: SplitCloudCommand(ConstItemList input_data, QUndoCommand* parent = nullptr); @@ -162,7 +163,7 @@ class SplitCloudCommand : public CloudCommand { private: }; -class DeleteItemCommand : public CloudCommand { +class PCL_EXPORTS DeleteItemCommand : public CloudCommand { public: DeleteItemCommand(ConstItemList input_data, QUndoCommand* parent = nullptr); @@ -178,7 +179,7 @@ class DeleteItemCommand : public CloudCommand { private: }; -class MergeCloudCommand : public CloudCommand { +class PCL_EXPORTS MergeCloudCommand : public CloudCommand { public: /** \brief Construct for a merge command * \param[in] input_data Input list of CloudItem s from the project model which will diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h index 3a60dcc1d8b..93c7352b3fa 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h @@ -40,6 +40,7 @@ #include #include #include +#include static QStringList ITEM_TYPES_STRINGS(QStringList() << "Cloud Composer Item" << "Cloud Item" @@ -62,7 +63,7 @@ enum { KD_TREE_SEARCH }; }; -class CloudComposerItem : public QStandardItem { +class PCL_EXPORTS CloudComposerItem : public QStandardItem { public: enum ItemType { CLOUD_COMPOSER_ITEM = QStandardItem::UserType, diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h index 126e8ff2faa..a2f8d8dac3c 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -68,7 +69,7 @@ enum PointType { AXIS = (1 << 5), }; } -class CloudItem : public CloudComposerItem { +class PCL_EXPORTS CloudItem : public CloudComposerItem { public: // This is needed because we have members which are Vector4f and Quaternionf PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h index e1241504fa1..798ec4fec3c 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h @@ -42,11 +42,12 @@ #include #include #include +#include namespace pcl { namespace cloud_composer { -class FPFHItem : public CloudComposerItem { +class PCL_EXPORTS FPFHItem : public CloudComposerItem { public: FPFHItem(QString name, const pcl::PointCloud::Ptr& fpfh_ptr, diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/normals_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/normals_item.h index 40fb5c3cfdc..a093bf10878 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/normals_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/normals_item.h @@ -44,7 +44,7 @@ namespace pcl { namespace cloud_composer { -class NormalsItem : public CloudComposerItem { +class PCL_EXPORTS NormalsItem : public CloudComposerItem { public: NormalsItem(QString name, const pcl::PointCloud::Ptr& normals_ptr, diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/interactor_style_switch.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/interactor_style_switch.h index f7905862197..fb5c82ee912 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/interactor_style_switch.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/interactor_style_switch.h @@ -76,7 +76,7 @@ class SelectedTrackballStyleInteractor; class ClickTrackballStyleInteractor; class ProjectModel; -class InteractorStyleSwitch : public vtkInteractorStyle { +class PCL_EXPORTS InteractorStyleSwitch : public vtkInteractorStyle { public: static InteractorStyleSwitch* New(); diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/selection_event.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/selection_event.h index e32d819afae..36bb9c76517 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/selection_event.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/point_selectors/selection_event.h @@ -49,7 +49,7 @@ namespace pcl { namespace cloud_composer { class RectangularFrustumSelector; -class SelectionEvent { +class PCL_EXPORTS SelectionEvent { public: SelectionEvent(vtkSmartPointer selected_points, diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/properties_model.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/properties_model.h index a4747ca42a5..818b064d239 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/properties_model.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/properties_model.h @@ -37,12 +37,14 @@ #pragma once +#include + #include namespace pcl { namespace cloud_composer { class CloudComposerItem; -class PropertiesModel : public QStandardItemModel { +class PCL_EXPORTS PropertiesModel : public QStandardItemModel { Q_OBJECT public: /** \brief Constructor used for tool parameters */ diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/tool_interface/abstract_tool.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/tool_interface/abstract_tool.h index aac5565ef4c..95acc5111d5 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/tool_interface/abstract_tool.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/tool_interface/abstract_tool.h @@ -40,13 +40,14 @@ #include #include #include +#include #include namespace pcl { namespace cloud_composer { -class AbstractTool : public QObject { +class PCL_EXPORTS AbstractTool : public QObject { Q_OBJECT public: AbstractTool(PropertiesModel* parameter_model, QObject* parent); @@ -87,7 +88,7 @@ class AbstractTool : public QObject { QString action_text_; }; -class ModifyItemTool : public AbstractTool { +class PCL_EXPORTS ModifyItemTool : public AbstractTool { Q_OBJECT public: ModifyItemTool(PropertiesModel* parameter_model, QObject* parent) @@ -111,7 +112,7 @@ class ModifyItemTool : public AbstractTool { } }; -class NewItemTool : public AbstractTool { +class PCL_EXPORTS NewItemTool : public AbstractTool { Q_OBJECT public: NewItemTool(PropertiesModel* parameter_model, QObject* parent) @@ -135,7 +136,7 @@ class NewItemTool : public AbstractTool { } }; -class SplitItemTool : public AbstractTool { +class PCL_EXPORTS SplitItemTool : public AbstractTool { Q_OBJECT public: SplitItemTool(PropertiesModel* parameter_model, QObject* parent) @@ -159,7 +160,7 @@ class SplitItemTool : public AbstractTool { } }; -class MergeCloudTool : public AbstractTool { +class PCL_EXPORTS MergeCloudTool : public AbstractTool { Q_OBJECT public: MergeCloudTool(PropertiesModel* parameter_model, QObject* parent) diff --git a/common/include/pcl/impl/point_types.hpp b/common/include/pcl/impl/point_types.hpp index c12552f8463..104d0280ab6 100644 --- a/common/include/pcl/impl/point_types.hpp +++ b/common/include/pcl/impl/point_types.hpp @@ -317,7 +317,7 @@ namespace pcl inline constexpr PointXYZ (float _x, float _y, float _z) : _PointXYZ{{{_x, _y, _z, 1.f}}} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZ& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZ& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -358,7 +358,7 @@ namespace pcl inline constexpr RGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a = 255) : _RGB{{{{_b, _g, _r, _a}}}} {} - friend std::ostream& operator << (std::ostream& os, const RGB& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const RGB& p); }; struct _Intensity @@ -377,7 +377,7 @@ namespace pcl inline constexpr Intensity (float _intensity = 0.f) : _Intensity{_intensity} {} - friend std::ostream& operator << (std::ostream& os, const Intensity& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Intensity& p); }; @@ -404,7 +404,7 @@ namespace pcl } #endif - friend std::ostream& operator << (std::ostream& os, const Intensity8u& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Intensity8u& p); }; struct _Intensity32u @@ -423,7 +423,7 @@ namespace pcl inline constexpr Intensity32u (std::uint32_t _intensity = 0) : _Intensity32u{_intensity} {} - friend std::ostream& operator << (std::ostream& os, const Intensity32u& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Intensity32u& p); }; /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value. @@ -452,7 +452,7 @@ namespace pcl inline constexpr PointXYZI (float _x, float _y, float _z, float _intensity = 0.f) : _PointXYZI{{{_x, _y, _z, 1.0f}}, {{_intensity}}} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZI& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZI& p); }; @@ -472,7 +472,7 @@ namespace pcl inline constexpr PointXYZL (float _x, float _y, float _z, std::uint32_t _label = 0) : _PointXYZL{{{_x, _y, _z, 1.0f}}, _label} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZL& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZL& p); }; @@ -483,7 +483,7 @@ namespace pcl inline constexpr Label (std::uint32_t _label = 0): label(_label) {} - friend std::ostream& operator << (std::ostream& os, const Label& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Label& p); }; @@ -530,7 +530,7 @@ namespace pcl inline constexpr PointXYZRGBA (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a) : _PointXYZRGBA{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, _a}}}} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p); }; @@ -597,7 +597,7 @@ namespace pcl std::uint8_t _r, std::uint8_t _g, std::uint8_t _b): _PointXYZRGB{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, 255}}}} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -621,7 +621,7 @@ namespace pcl std::uint32_t _label = 0, std::uint8_t _a = 255) : _PointXYZRGBL{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, _a}}}, _label} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -656,7 +656,7 @@ namespace pcl float _l, float _a, float _b) : _PointXYZLAB{ {{_x, _y, _z, 1.0f}}, {{_l, _a, _b}} } {} - friend std::ostream& operator << (std::ostream& os, const PointXYZLAB& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZLAB& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -694,7 +694,7 @@ namespace pcl float _h, float _s, float _v) : _PointXYZHSV{{{_x, _y, _z, 1.0f}}, {{_h, _s, _v}}} {} - friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -721,7 +721,7 @@ namespace pcl inline pcl::Vector2fMap getVector2fMap () { return (pcl::Vector2fMap (data)); } inline pcl::Vector2fMapConst getVector2fMap () const { return (pcl::Vector2fMapConst (data)); } - friend std::ostream& operator << (std::ostream& os, const PointXY& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXY& p); }; // NOLINTEND(modernize-use-default-member-init) @@ -739,7 +739,7 @@ namespace pcl inline constexpr PointUV(float _u, float _v): u(_u), v(_v) {} - friend std::ostream& operator << (std::ostream& os, const PointUV& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointUV& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p); @@ -760,7 +760,7 @@ namespace pcl }; PCL_MAKE_ALIGNED_OPERATOR_NEW - friend std::ostream& operator << (std::ostream& os, const InterestPoint& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const InterestPoint& p); }; struct EIGEN_ALIGN16 _Normal @@ -790,7 +790,7 @@ namespace pcl inline constexpr Normal (float n_x, float n_y, float n_z, float _curvature = 0.f) : _Normal{{{n_x, n_y, n_z, 0.0f}}, {{_curvature}}} {} - friend std::ostream& operator << (std::ostream& os, const Normal& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Normal& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -813,7 +813,7 @@ namespace pcl inline constexpr Axis (float n_x, float n_y, float n_z) : _Axis{{{n_x, n_y, n_z, 0.0f}}} {} - friend std::ostream& operator << (std::ostream& os, const Axis& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Axis& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -849,7 +849,7 @@ namespace pcl inline constexpr PointNormal (float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature = 0.f) : _PointNormal{{{_x, _y, _z, 1.0f}}, {{n_x, n_y, n_z, 0.0f}}, {{_curvature}}} {} - friend std::ostream& operator << (std::ostream& os, const PointNormal& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointNormal& p); }; @@ -936,7 +936,7 @@ namespace pcl {} - friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p); }; struct EIGEN_ALIGN16 _PointXYZINormal @@ -978,7 +978,7 @@ namespace pcl } {} - friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p); }; //---- @@ -1021,7 +1021,7 @@ namespace pcl } {} - friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p); }; // --- @@ -1054,7 +1054,7 @@ namespace pcl inline constexpr PointWithRange (float _x, float _y, float _z, float _range = 0.f) : _PointWithRange{{{_x, _y, _z, 1.0f}}, {{_range}}} {} - friend std::ostream& operator << (std::ostream& os, const PointWithRange& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointWithRange& p); }; @@ -1089,7 +1089,7 @@ namespace pcl inline constexpr PointWithViewpoint (float _x, float _y, float _z, float _vp_x, float _vp_y, float _vp_z) : _PointWithViewpoint{{{_x, _y, _z, 1.0f}}, {{_vp_x, _vp_y, _vp_z}}} {} - friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p); @@ -1104,7 +1104,7 @@ namespace pcl inline constexpr MomentInvariants (float _j1, float _j2, float _j3): j1 (_j1), j2 (_j2), j3 (_j3) {} - friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p); @@ -1119,7 +1119,7 @@ namespace pcl inline constexpr PrincipalRadiiRSD (float _r_min, float _r_max): r_min (_r_min), r_max (_r_max) {} - friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p); @@ -1139,7 +1139,7 @@ namespace pcl inline constexpr Boundary (std::uint8_t _boundary = 0): boundary_point (_boundary) {} - friend std::ostream& operator << (std::ostream& os, const Boundary& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Boundary& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p); @@ -1170,7 +1170,7 @@ namespace pcl inline constexpr PrincipalCurvatures (float _x, float _y, float _z, float _pc1, float _pc2): principal_curvature_x (_x), principal_curvature_y (_y), principal_curvature_z (_z), pc1 (_pc1), pc2 (_pc2) {} - friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p); @@ -1184,7 +1184,7 @@ namespace pcl inline constexpr PFHSignature125 () = default; - friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p); }; @@ -1199,7 +1199,7 @@ namespace pcl inline constexpr PFHRGBSignature250 () = default; - friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p); @@ -1216,7 +1216,7 @@ namespace pcl inline constexpr PPFSignature (float _f1, float _f2, float _f3, float _f4, float _alpha = 0.f): f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), alpha_m (_alpha) {} - friend std::ostream& operator << (std::ostream& os, const PPFSignature& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PPFSignature& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const CPPFSignature& p); @@ -1236,7 +1236,7 @@ namespace pcl f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), f5 (_f5), f6 (_f6), f7 (_f7), f8 (_f8), f9 (_f9), f10 (_f10), alpha_m (_alpha) {} - friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p); @@ -1257,7 +1257,7 @@ namespace pcl inline constexpr PPFRGBSignature (float _f1, float _f2, float _f3, float _f4, float _alpha, float _r, float _g, float _b): f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), r_ratio (_r), g_ratio (_g), b_ratio (_b), alpha_m (_alpha) {} - friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p); @@ -1271,7 +1271,7 @@ namespace pcl inline constexpr NormalBasedSignature12 () = default; - friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p); @@ -1286,7 +1286,7 @@ namespace pcl inline constexpr ShapeContext1980 () = default; - friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p); @@ -1301,7 +1301,7 @@ namespace pcl inline constexpr UniqueShapeContext1960 () = default; - friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p); @@ -1316,7 +1316,7 @@ namespace pcl inline constexpr SHOT352 () = default; - friend std::ostream& operator << (std::ostream& os, const SHOT352& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const SHOT352& p); }; @@ -1332,7 +1332,7 @@ namespace pcl inline constexpr SHOT1344 () = default; - friend std::ostream& operator << (std::ostream& os, const SHOT1344& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const SHOT1344& p); }; @@ -1385,7 +1385,7 @@ namespace pcl inline constexpr ReferenceFrame (const float (&_rf)[9]) : _ReferenceFrame{ {{_rf[0], _rf[1], _rf[2], _rf[3], _rf[4], _rf[5], _rf[6], _rf[7], _rf[8]}} } {} - friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p); PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -1401,7 +1401,7 @@ namespace pcl inline constexpr FPFHSignature33 () = default; - friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p); @@ -1415,7 +1415,7 @@ namespace pcl inline constexpr VFHSignature308 () = default; - friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GRSDSignature21& p); @@ -1429,7 +1429,7 @@ namespace pcl inline constexpr GRSDSignature21 () = default; - friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BRISKSignature512& p); @@ -1447,7 +1447,7 @@ namespace pcl inline constexpr BRISKSignature512 (float _scale, float _orientation): scale (_scale), orientation (_orientation) {} - friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p); @@ -1461,7 +1461,7 @@ namespace pcl inline constexpr ESFSignature640 () = default; - friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature512& p); @@ -1475,7 +1475,7 @@ namespace pcl inline constexpr GASDSignature512 () = default; - friend std::ostream& operator << (std::ostream& os, const GASDSignature512& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const GASDSignature512& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature984& p); @@ -1489,7 +1489,7 @@ namespace pcl inline constexpr GASDSignature984 () = default; - friend std::ostream& operator << (std::ostream& os, const GASDSignature984& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const GASDSignature984& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature7992& p); @@ -1503,7 +1503,7 @@ namespace pcl inline constexpr GASDSignature7992 () = default; - friend std::ostream& operator << (std::ostream& os, const GASDSignature7992& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const GASDSignature7992& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p); @@ -1517,7 +1517,7 @@ namespace pcl inline constexpr GFPFHSignature16 () = default; - friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p); @@ -1537,7 +1537,7 @@ namespace pcl inline constexpr Narf36 (float _x, float _y, float _z, float _roll, float _pitch, float _yaw): x (_x), y (_y), z (_z), roll (_roll), pitch (_pitch), yaw (_yaw) {} - friend std::ostream& operator << (std::ostream& os, const Narf36& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const Narf36& p); }; PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p); @@ -1554,7 +1554,7 @@ namespace pcl inline constexpr BorderDescription (int _x, int _y) : x(_x), y(_y) {} - friend std::ostream& operator << (std::ostream& os, const BorderDescription& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const BorderDescription& p); }; @@ -1578,7 +1578,7 @@ namespace pcl inline constexpr IntensityGradient (): IntensityGradient (0.f, 0.f, 0.f) {} inline constexpr IntensityGradient (float _x, float _y, float _z): gradient_x (_x), gradient_y (_y), gradient_z (_z) {} - friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p); }; // TODO: Maybe make other histogram based structs an alias for this @@ -1628,7 +1628,7 @@ namespace pcl float _angle = -1.f, float _response = 0.f, int _octave = 0) : _PointWithScale{{{_x, _y, _z, 1.0f}}, {_scale}, _angle, _response, _octave } {} - friend std::ostream& operator << (std::ostream& os, const PointWithScale& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointWithScale& p); }; @@ -1673,7 +1673,7 @@ namespace pcl } {} - friend std::ostream& operator << (std::ostream& os, const PointSurfel& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointSurfel& p); }; struct EIGEN_ALIGN16 _PointDEM @@ -1702,7 +1702,7 @@ namespace pcl float _intensity_variance, float _height_variance) : _PointDEM{{{_x, _y, _z, 1.0f}}, _intensity, _intensity_variance, _height_variance} {} - friend std::ostream& operator << (std::ostream& os, const PointDEM& p); + PCL_EXPORTS friend std::ostream& operator << (std::ostream& os, const PointDEM& p); }; template std::ostream& diff --git a/surface/include/pcl/surface/on_nurbs/fitting_surface_tdm.h b/surface/include/pcl/surface/on_nurbs/fitting_surface_tdm.h index 4960da85905..378dd32248b 100644 --- a/surface/include/pcl/surface/on_nurbs/fitting_surface_tdm.h +++ b/surface/include/pcl/surface/on_nurbs/fitting_surface_tdm.h @@ -47,7 +47,7 @@ namespace pcl * Based on paper: TODO * \author Thomas Mörwald * \ingroup surface */ - class FittingSurfaceTDM : public FittingSurface + class PCL_EXPORTS FittingSurfaceTDM : public FittingSurface { public: using FittingSurface::assemble; From 5134923ebd0993ef9cf4809a74430f99a16be9e8 Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:41 +0100 Subject: [PATCH 04/10] Add ability to disable export on dlls - since the dlls created by cloud_composer are plugins and should not be imported, but found using qts dll loading system. --- apps/cloud_composer/CMakeLists.txt | 9 --------- apps/cloud_composer/ComposerTool.cmake | 2 +- cmake/pcl_targets.cmake | 16 ++++++++++++---- common/include/pcl/pcl_exports.h | 2 +- common/include/pcl/pcl_macros.h | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/apps/cloud_composer/CMakeLists.txt b/apps/cloud_composer/CMakeLists.txt index 47668e169a4..831e32e29b0 100644 --- a/apps/cloud_composer/CMakeLists.txt +++ b/apps/cloud_composer/CMakeLists.txt @@ -64,17 +64,9 @@ set(INTERFACE_SOURCES src/tool_interface/abstract_tool.cpp ) -# Build pcl_cc_tool_interface as static library, to fix issue mentioned in #2708 -set(PCL_LIB_TYPE_ORIGIN ${PCL_LIB_TYPE}) -set(PCL_LIB_TYPE STATIC) - PCL_ADD_LIBRARY(pcl_cc_tool_interface COMPONENT ${SUBSUBSYS_NAME} SOURCES ${INTERFACE_HEADERS} ${INTERFACE_SOURCES}) - - target_link_libraries(pcl_cc_tool_interface pcl_common pcl_features pcl_filters pcl_search pcl_visualization ${QTX}::Widgets) -set(PCL_LIB_TYPE ${PCL_LIB_TYPE_ORIGIN}) - if(APPLE) set_target_properties(pcl_cc_tool_interface PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") endif() @@ -134,7 +126,6 @@ PCL_ADD_INCLUDES("${SUBSUBSYS_NAME}" "${SUBSUBSYS_NAME}/impl" ${impl_incs}) PCL_MAKE_PKGCONFIG(${EXE_NAME} COMPONENT ${SUBSUBSYS_NAME} DESC ${SUBSYS_DESC}) - #TOOL buildING SCRIPTS include(ComposerTool.cmake REQUIRED) diff --git a/apps/cloud_composer/ComposerTool.cmake b/apps/cloud_composer/ComposerTool.cmake index bf6d80b64da..0560361c363 100644 --- a/apps/cloud_composer/ComposerTool.cmake +++ b/apps/cloud_composer/ComposerTool.cmake @@ -4,7 +4,7 @@ function(define_composer_tool TOOL_NAME TOOL_SOURCES TOOL_HEADERS DEPS) project(pcl_cc_tool_${TOOL_NAME}) set(TOOL_TARGET pcl_cc_tool_${TOOL_NAME}) - PCL_ADD_LIBRARY(${TOOL_TARGET} COMPONENT ${SUBSYS_NAME} SOURCES ${TOOL_SOURCES} ${TOOL_HEADERS}) + PCL_ADD_LIBRARY(${TOOL_TARGET} COMPONENT ${SUBSYS_NAME} SOURCES ${TOOL_SOURCES} ${TOOL_HEADERS} EXPORT_SYMBOLS FALSE) if(WIN32) set_target_properties (${TOOL_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CLOUD_COMPOSER_PLUGIN_DIR} diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index 32281f20700..a845904d836 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -171,7 +171,7 @@ endmacro() # SOURCES The source files for the library. function(PCL_ADD_LIBRARY _name) set(options) - set(oneValueArgs COMPONENT) + set(oneValueArgs COMPONENT EXPORT_SYMBOLS) set(multiValueArgs SOURCES INCLUDES) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -222,11 +222,19 @@ function(PCL_ADD_LIBRARY _name) if(MSVC) target_link_libraries(${_name} delayimp.lib) # because delay load is enabled for openmp.dll endif() - + + if(NOT DEFINED ARGS_EXPORT_SYMBOLS) + set(ARGS_EXPORT_SYMBOLS TRUE) + endif() + + if(ARGS_EXPORT_SYMBOLS) + set_target_properties(${_name} PROPERTIES + DEFINE_SYMBOL "PCLAPI_EXPORTS") + endif() + set_target_properties(${_name} PROPERTIES VERSION ${PCL_VERSION} - SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR} - DEFINE_SYMBOL "PCLAPI_EXPORTS") + SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}) set_target_properties(${_name} PROPERTIES FOLDER "Libraries") endif() diff --git a/common/include/pcl/pcl_exports.h b/common/include/pcl/pcl_exports.h index f386303bc46..00c4f791f83 100644 --- a/common/include/pcl/pcl_exports.h +++ b/common/include/pcl/pcl_exports.h @@ -44,7 +44,7 @@ #ifdef PCLAPI_EXPORTS #define PCL_EXPORTS __declspec(dllexport) #else - #define PCL_EXPORTS + #define PCL_EXPORTS __declspec(dllimport) #endif #else #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN diff --git a/common/include/pcl/pcl_macros.h b/common/include/pcl/pcl_macros.h index fdc7e9f9106..a30909752ef 100644 --- a/common/include/pcl/pcl_macros.h +++ b/common/include/pcl/pcl_macros.h @@ -319,7 +319,7 @@ pcl_round (float number) #ifdef PCLAPI_EXPORTS #define PCL_EXPORTS __declspec(dllexport) #else - #define PCL_EXPORTS + #define PCL_EXPORTS __declspec(dllimport) #endif #else #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN From 525cd2b596451e850d027ac66f64d30e87a3c68f Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:50 +0100 Subject: [PATCH 05/10] Remove export as all members are inline. --- recognition/include/pcl/recognition/surface_normal_modality.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recognition/include/pcl/recognition/surface_normal_modality.h b/recognition/include/pcl/recognition/surface_normal_modality.h index 538e88c598d..9ed1311d510 100644 --- a/recognition/include/pcl/recognition/surface_normal_modality.h +++ b/recognition/include/pcl/recognition/surface_normal_modality.h @@ -59,7 +59,7 @@ namespace pcl /** \brief Map that stores orientations. * \author Stefan Holzer */ - struct PCL_EXPORTS LINEMOD_OrientationMap + struct LINEMOD_OrientationMap { public: /** \brief Constructor. */ From 8aa2d64748e998b519df6d2f6fe0aa2102979d69 Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Tue, 17 Mar 2026 17:18:59 +0100 Subject: [PATCH 06/10] Update pcl_exports to handle static build by defining PCL_EXPORTS as empty. Unify the check for WIN32. --- cmake/pcl_targets.cmake | 3 +++ common/include/pcl/pcl_exports.h | 26 +++++++++++++++----------- common/include/pcl/pcl_macros.h | 26 +++++++++++++++----------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index a845904d836..1402faead17 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -232,6 +232,9 @@ function(PCL_ADD_LIBRARY _name) DEFINE_SYMBOL "PCLAPI_EXPORTS") endif() + target_compile_definitions( + ${_name} PUBLIC "$,PCLAPI_EXPORTS,PCL_STATIC_DEFINE>") + set_target_properties(${_name} PROPERTIES VERSION ${PCL_VERSION} SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}) diff --git a/common/include/pcl/pcl_exports.h b/common/include/pcl/pcl_exports.h index 00c4f791f83..226080907e5 100644 --- a/common/include/pcl/pcl_exports.h +++ b/common/include/pcl/pcl_exports.h @@ -40,16 +40,20 @@ // Header 'pcl_macros' is not suitable since it includes , // which can't be eaten by nvcc (it's too weak) -#if defined _WIN32 || defined WINCE || defined __MINGW32__ - #ifdef PCLAPI_EXPORTS - #define PCL_EXPORTS __declspec(dllexport) - #else - #define PCL_EXPORTS __declspec(dllimport) - #endif +#ifdef PCL_STATIC_DEFINE + #define PCL_EXPORTS #else - #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN - #define PCL_EXPORTS __attribute__ ((visibility ("default"))) - #else - #define PCL_EXPORTS - #endif + #if defined WIN32 || defined _WIN32 || defined WINCE || defined __MINGW32__ + #ifdef PCLAPI_EXPORTS + #define PCL_EXPORTS __declspec(dllexport) + #else + #define PCL_EXPORTS __declspec(dllimport) + #endif + #else + #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN + #define PCL_EXPORTS __attribute__ ((visibility ("default"))) + #else + #define PCL_EXPORTS + #endif + #endif #endif diff --git a/common/include/pcl/pcl_macros.h b/common/include/pcl/pcl_macros.h index a30909752ef..a3832b30a47 100644 --- a/common/include/pcl/pcl_macros.h +++ b/common/include/pcl/pcl_macros.h @@ -315,18 +315,22 @@ pcl_round (float number) #endif #endif -#if defined WIN32 || defined _WIN32 || defined WINCE || defined __MINGW32__ - #ifdef PCLAPI_EXPORTS - #define PCL_EXPORTS __declspec(dllexport) - #else - #define PCL_EXPORTS __declspec(dllimport) - #endif +#ifdef PCL_STATIC_DEFINE + #define PCL_EXPORTS #else - #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN - #define PCL_EXPORTS __attribute__ ((visibility ("default"))) - #else - #define PCL_EXPORTS - #endif + #if defined WIN32 || defined _WIN32 || defined WINCE || defined __MINGW32__ + #ifdef PCLAPI_EXPORTS + #define PCL_EXPORTS __declspec(dllexport) + #else + #define PCL_EXPORTS __declspec(dllimport) + #endif + #else + #ifdef PCL_SYMBOL_VISIBILITY_HIDDEN + #define PCL_EXPORTS __attribute__ ((visibility ("default"))) + #else + #define PCL_EXPORTS + #endif + #endif #endif #if defined WIN32 || defined _WIN32 From 8b309042bb8cca817e61c57073bf3cc32ffb355f Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Fri, 20 Mar 2026 18:09:52 +0100 Subject: [PATCH 07/10] Make kdtree an interface library if PCL_NO_PRECOMPILE is true. --- kdtree/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kdtree/CMakeLists.txt b/kdtree/CMakeLists.txt index 88b293d0a05..1aa1f48ce7e 100644 --- a/kdtree/CMakeLists.txt +++ b/kdtree/CMakeLists.txt @@ -29,7 +29,8 @@ set(impl_incs ) set(LIB_NAME "pcl_${SUBSYS_NAME}") -if(FLANN_FOUND) +# PCL_ADD_LIBRARY will create an INTERFACE library if no sources are added and a normal library if sources are present. +if((NOT PCL_NO_PRECOMPILE) AND FLANN_FOUND) PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) target_link_libraries("${LIB_NAME}" pcl_common FLANN::FLANN) set(EXT_DEPS flann) From b1817f574a6fd63e29724f77e8ed66c207db30fc Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Fri, 20 Mar 2026 18:35:59 +0100 Subject: [PATCH 08/10] Fix formatting. --- .../include/pcl/apps/cloud_composer/items/cloud_composer_item.h | 2 +- .../include/pcl/apps/cloud_composer/items/cloud_item.h | 2 +- .../include/pcl/apps/cloud_composer/items/fpfh_item.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h index 93c7352b3fa..2def559f3d3 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_composer_item.h @@ -39,8 +39,8 @@ #include #include -#include #include +#include static QStringList ITEM_TYPES_STRINGS(QStringList() << "Cloud Composer Item" << "Cloud Item" diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h index a2f8d8dac3c..906cf81c755 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h @@ -43,11 +43,11 @@ #include #include #include +#include #include #include #include #include -#include #include diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h index 798ec4fec3c..a90c88e179d 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/fpfh_item.h @@ -41,8 +41,8 @@ #include #include #include -#include #include +#include namespace pcl { namespace cloud_composer { From bdd8ae4f27199a13a384ebd23e2a222d7be2cbea Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Sat, 21 Mar 2026 12:20:03 +0100 Subject: [PATCH 09/10] Avoid generator expression for easier reading. Remember to add defines for CUDA libraries. Only add export flags, if they should be exported. If not the would default to import (cloud composer plugins). --- cmake/pcl_targets.cmake | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index 1402faead17..57634fbbbba 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -228,13 +228,13 @@ function(PCL_ADD_LIBRARY _name) endif() if(ARGS_EXPORT_SYMBOLS) - set_target_properties(${_name} PROPERTIES - DEFINE_SYMBOL "PCLAPI_EXPORTS") + if(PCL_SHARED_LIBS) + target_compile_definitions(${_name} PRIVATE PCLAPI_EXPORTS) + else() + target_compile_definitions(${_name} PRIVATE PCL_STATIC_DEFINE) + endif() endif() - target_compile_definitions( - ${_name} PUBLIC "$,PCLAPI_EXPORTS,PCL_STATIC_DEFINE>") - set_target_properties(${_name} PROPERTIES VERSION ${PCL_VERSION} SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}) @@ -260,7 +260,7 @@ endfunction() # SOURCES The source files for the library. function(PCL_CUDA_ADD_LIBRARY _name) set(options) - set(oneValueArgs COMPONENT) + set(oneValueArgs COMPONENT EXPORT_SYMBOLS) set(multiValueArgs SOURCES INCLUDES) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -304,11 +304,19 @@ function(PCL_CUDA_ADD_LIBRARY _name) if(MSVC) target_link_libraries(${_name} delayimp.lib) # because delay load is enabled for openmp.dll endif() - - set_target_properties(${_name} PROPERTIES - VERSION ${PCL_VERSION} - SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR} - DEFINE_SYMBOL "PCLAPI_EXPORTS") + + if(NOT DEFINED ARGS_EXPORT_SYMBOLS) + set(ARGS_EXPORT_SYMBOLS TRUE) + endif() + + if(ARGS_EXPORT_SYMBOLS) + if(PCL_SHARED_LIBS) + target_compile_definitions(${_name} PRIVATE PCLAPI_EXPORTS) + else() + target_compile_definitions(${_name} PRIVATE PCL_STATIC_DEFINE) + endif() + endif() + set_target_properties(${_name} PROPERTIES FOLDER "Libraries") endif() From 2b526094f29e8d6a8714a6564dd61acf20ba1aff Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Sat, 21 Mar 2026 12:20:48 +0100 Subject: [PATCH 10/10] Redo opennurbs_defines to match PCLs structure for both windows and linux. But still use OPENNURBS_EXPORTS as it was used multiple places. --- .../3rdparty/opennurbs/opennurbs_defines.h | 68 ++++++++----------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h index 7ce1b12e15d..3579b225c15 100644 --- a/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h +++ b/surface/include/pcl/surface/3rdparty/opennurbs/opennurbs_defines.h @@ -61,63 +61,51 @@ // */ -#if defined(OPENNURBS_EXPORTS) -// OPENNURBS_EXPORTS is Microsoft's prefered defined for building an opennurbs DLL. -#if !defined(ON_DLL_EXPORTS) -#define ON_DLL_EXPORTS -#endif -#if !defined(ON_COMPILING_OPENNURBS) -#define ON_COMPILING_OPENNURBS -#endif -#endif - -#if defined(OPENNURBS_IMPORTS) -// OPENNURBS_EXPORTS is Microsoft's prefered defined for linking with an opennurbs DLL. -#if !defined(ON_DLL_IMPORTS) -#define ON_DLL_IMPORTS -#endif -#endif - -#if defined(ON_DLL_EXPORTS) && defined(ON_DLL_IMPORTS) -#error At most one of ON_DLL_EXPORTS and ON_DLL_IMPORTS can be defined. -#endif +#ifdef PCL_STATIC_DEFINE -/* export/import */ -#if defined(ON_DLL_EXPORTS) +/* compiling or using OpenNurbs as a static library */ +#define ON_CLASS +#define ON_DECL +#define ON_EXTERN_DECL -#if !defined(ON_COMPILING_OPENNURBS) -#error When compiling an OpenNURBS DLL, ON_DLL_EXPORTS must be defined +#if defined(ON_DLL_TEMPLATE) +#undef ON_DLL_TEMPLATE #endif -/* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and globals */ +#else +#if defined WIN32 || defined _WIN32 || defined WINCE || defined __MINGW32__ +#ifdef OPENNURBS_EXPORTS +/* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and + * globals */ #define ON_CLASS __declspec(dllexport) #define ON_DECL __declspec(dllexport) #define ON_EXTERN_DECL __declspec(dllexport) #define ON_DLL_TEMPLATE - -#elif defined(ON_DLL_IMPORTS) - -#if defined(ON_COMPILING_OPENNURBS) -#error When compiling an OpenNURBS DLL, ON_DLL_IMPORTS must NOT be defined -#endif - -/* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals */ +#define ON_DLL_EXPORTS +#else +/* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals + */ #define ON_CLASS __declspec(dllimport) #define ON_DECL __declspec(dllimport) #define ON_EXTERN_DECL __declspec(dllimport) #define ON_DLL_TEMPLATE extern - +#define ON_DLL_IMPORTS +#endif +#else +#ifdef PCL_SYMBOL_VISIBILITY_HIDDEN +#define ON_CLASS __attribute__((visibility("default"))) +#define ON_DECL __attribute__((visibility("default"))) +#define ON_EXTERN_DECL __attribute__((visibility("default"))) +#define ON_DLL_TEMPLATE +#define ON_DLL_EXPORTS #else - -/* compiling or using OpenNurbs as a static library */ #define ON_CLASS #define ON_DECL #define ON_EXTERN_DECL - -#if defined(ON_DLL_TEMPLATE) -#undef ON_DLL_TEMPLATE +#define ON_DLL_TEMPLATE +#define ON_DLL_EXPORTS +#endif #endif - #endif