Skip to content

cannot build PCL with boost dynamic linking #279

@rdiankov

Description

@rdiankov

it looks like pcl is hardcoding that boost is always statically linked on windows inside the pcl_find_boost.cmake file.

The line here is what does the forcing:

if(NOT PCL_SHARED_LIBS OR WIN32)
  set(Boost_USE_STATIC_LIBS ON)
  set(Boost_USE_STATIC ON)
endif(NOT PCL_SHARED_LIBS OR WIN32)

We need an option in cmake to allow for boost. specifically, the following options need to be set:

-DBoost_USE_MULTITHREAD=ON -DBoost_USE_STATIC_LIBS=OFF -DBoost_USE_STATIC=OFF

Also we need to pass two defines to tell boost to do DLL linking to C++

BOOST_ALL_DYN_LINK
BOOST_ALL_NO_LIB

So on the cmake command line i'm thinking of doing this:

CXXFLAGS="-DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB"

can we allow PCL cmake file to configure itself for dynamic linking also?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions