[英]CMake Boost 1.59.0 geometry
I am fairly new to using boost along with C++. 对于将Boost与C ++一起使用,我是相当陌生的。 I have just installed Boost 1.59.0 and I want to use the geometry library. 我刚刚安装了Boost 1.59.0,并且想使用几何图形库。
If I include FIND_PACKAGE( Boost 1.47 REQUIRED )
it finds boost and no problems arises. 如果我包含FIND_PACKAGE( Boost 1.47 REQUIRED )
它将找到boost并且不会出现问题。 If I then include FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED )
I get the following error: 如果然后包含FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED )
出现以下错误:
Unable to find the requested Boost libraries.
Boost version: 1.59.0
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_geometry
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
If I run the following [ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found"
如果我运行以下[ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found"
[ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found"
in the CLI I get Found
as a result. [ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found"
在CLI我得到Found
结果。 So it seems that it's there, but CMake tells me it's not. 看来它在那里,但是CMake告诉我它不在。
What am I misunderstanding? 我有什么误会?
COMPONENTS
is required only for built libraries. 仅对于内置库,才需要COMPONENTS
。 Geometry is an header-only library so it's not needed. 几何是仅标头的库,因此不需要。 You need only to find the boost headers location. 您只需要找到升压接头的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.