E0145 Member may not be initialized- cmake - VS2017

被刻印的时光 ゝ 提交于 2019-12-11 09:53: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.

来源:https://stackoverflow.com/questions/53737774/e0145-member-may-not-be-initialized-cmake-vs2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!