问题
I am trying to link a C++ application with PCL library. I installed PCL and all its dependencies using VCPKG. I am using Visual Studio 2017 and cmake 3.12 for X64. When I am trying to build the solution it is giving me the following Errors.
E0145 member "boost::filesystem::path::separator" may not be initialized
C:\vcpkg-pcl\vcpkg-master\installed\x64-
windows\include\boost\filesystem\path.hpp 65
E0145 member "boost::filesystem::path::preferred_separator" may not be
initialized C:\vcpkg-pcl\vcpkg-master\installed\x64-
windows\include\boost\filesystem\path.hpp 66
E0145 member "boost::filesystem::path::dot" may not be initialized
C:\vcpkg-pcl\vcpkg-master\installed\x64-
windows\include\boost\filesystem\path.hpp 67
E2512 the argument to a feature-test macro must be a simple identifier
C:\vcpkg-pcl\vcpkg-master\installed\x64-
windows\include\boost\system\error_code.hpp 401
On the console I find this error, eventhough I installed Pthreads library using VCPKG and set the PTHREADS_INCLUDE variable
-- Looking for pthread.h - not found
This is my CMakelists.txt file
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(compute_parameters)
find_package(PCL 1.5 REQUIRED)
SET(PTHREADS_INCLUDE "${PTHREADS_ROOT}/include")
find_path (PTHREADS_INCLUDE "pthread.h" NO_CMAKE_FIND_ROOT_PATH)
include_directories(${PCL_INCLUDE_DIRS};${PTHREADS_INCLUDE})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (compute_parameters compute_parameters.cpp)
target_link_libraries (compute_parameters ${PCL_LIBRARIES})
Any help will be appreciated.
来源:https://stackoverflow.com/questions/53737774/e0145-member-may-not-be-initialized-cmake-vs2017