我正在尝试将C ++应用程序与PCL库链接。我使用VCPKG安装了PCL及其所有依赖项。我正在使用Visual Studio 2017和X64的cmake 3.12。当我尝试构建解决方案时,出现以下错误。
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
即使我使用VCPKG安装了Pthreads库并设置了PTHREADS_INCLUDE变量,在控制台上我仍然发现此错误
-- Looking for pthread.h - not found
这是我的CMakelists.txt文件
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})
任何帮助将不胜感激。