Reputation: 2070
How can I get around missing boost::throw_exception
while building PCL?
I've built PCL on Windows (MSVC 2013) a few times in the past, but I've never see this error. It's been blocking me all today and yesterday:
LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXAEBVexception@std@@@Z) referenced in function "public: __cdecl boost::detail::shared_count::shared_count<struct pcl::io::ply::ply_parser::list_property<unsigned char,signed char> >(struct pcl::io::ply::ply_parser::list_property<unsigned char,signed char> *)" (??$?0U?$list_property@EC@ply_parser@ply@io@pcl@@@shared_count@detail@boost@@QEAA@PEAU?$list_property@EC@ply_parser@ply@io@pcl@@@Z) [C:\Users\mrussell\.conan\data\pcl\1.7.2\ntc\stable\build\d63ff451cbfa147e3b952f2f3790530e1116d93c\io\pcl_io_ply.vcxproj]
It appears that BOOST_NO_EXCEPTIONS
is set in boost\config\compiler\visualc.hpp
, which prevents boost/throw_exception.hpp
from defining it.
I've tried to set TPN_WIN32
to /EHsc
(see this answer) both through CMake and via the project properties in Visual Studio to no avail, and even tried sneaking a definition into a high level PCL include (see this answer), nothing worked.
My CMake generator is Visual Studio 12 2013 Win64
and my definitions are:
-DBOOST_ROOT:PATH=%CONAN_BOOST%
-DCMAKE_INSTALL_PREFIX=%CONAN_PCL%
-DEIGEN3_DIR:PATH=%CONAN_EIGEN%\share\eigen3\cmake
-DEIGEN_INCLUDE_DIR:PATH=%CONAN_EIGEN%\include\eigen3
-DFLANN_INCLUDE_DIR:PATH=%CONAN_FLANN%\include
-DFLANN_LIBRARY:FILEPATH=%CONAN_FLANN%\lib\libflann_cpp.so
-DQHULL_INCLUDE_DIR:PATH=%CONAN_QHULL%\include
-DQHULL_LIBRARY:FILEPATH=%CONAN_QHULL%\lib\libqhull.so
-DGTEST_ROOT:PATH=%CONAN_GTEST%
-DBUILD_surface_on_nurbs:BOOL=ON
I've tried:
I feel like I'm chasing the wrong thing, or am missing something. Maybe I'm missing a _CPPUNWIND
define for exceptions? I'm really just stuck.
Upvotes: 1
Views: 1531
Reputation: 86
TPN_WIN32
is a user defined variable on that post you reference. You need to append /EHsc
to your CMAKE_CXX_FLAGS
to pass it to the compiler.
Unrelated but really suspicious -DFLANN_LIBRARY:FILEPATH=%CONAN_FLANN%\lib\libflann_cpp.so
is a unix dynamic library. You can't link it on windows with MSVC.
Upvotes: 0