E0145 Member may not be initialized- cmake - VS201

2019-07-29 18:29发布

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.

0条回答
登录 后发表回答