libst 1.64.0和Eclipse Luna

时间:2017-06-06 15:12:16

标签: c++ linux eclipse boost

我试图让Boost libs与Eclipse Luna一起工作(我知道它是一个旧版本,但我与它合作)。 我的系统是Linux Mint 18.1。 我在this guide之后下载,解压缩并安装了库。 我最终在我的主文件夹中解压缩了库,并在usr / local / include / boost文件夹中编译了这些库。 接下来,我将后者添加到LD LIBRARY PATH并重置了ldconfig。

此时我在一个空的C ++项目上复制了一些代码。 我使用的标题是" share_ptr.hpp"所以我设置#include。 之后,我在Project - >下添加了包含头的include路径。属性 - > C / C ++一般 - >路径和符号。 我将路径/ usr / local / include添加为包含目录。

当我构建时,我收到错误:"没有这样的文件或目录"。 如果我#include带有绝对路径的头文件,我可以找到该文件,但是我得到另一个错误,因为这个.hpp文件引用了" relative" path / boost / smart_ptr / share_ptr,所以它找不到所有这些标题:

#ifndef BOOST_SMART_PTR_HPP_INCLUDED
#define BOOST_SMART_PTR_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
# include <boost/weak_ptr.hpp>
# include <boost/intrusive_ptr.hpp>
# include <boost/enable_shared_from_this.hpp>
# include <boost/make_shared.hpp>
#endif
#endif // #ifndef BOOST_SMART_PTR_HPP_INCLUDED

在我看来,Eclipse无法正确获取包含路径。

我尝试的另一件事是为链接器添加-L,但它也不起作用。

这就是我所包含的内容:

#include <vector>
#include <boost/shared_ptr.hpp>

你能帮我理解它的发生情况吗?

添加信息: 代码:

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}

CONSOLE:

08:13:11 **** Incremental Build of configuration Build (GNU) for project TESTCODE ****
make all 
make  all-recursive
make[1]: Entering directory '/home/daniele/workspace/TESTCODE'
Making all in src
make[2]: Entering directory '/home/daniele/workspace/TESTCODE/src'
arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/fsl-imx-fb/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi -DHAVE_CONFIG_H -I. -I..   --sysroot=/opt/fsl-imx-fb/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi  -g -O0  --sysroot=/opt/fsl-imx-fb/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi -MT TESTCODE.o -MD -MP -MF .deps/TESTCODE.Tpo -c -o TESTCODE.o TESTCODE.cpp
TESTCODE.cpp:11:35: fatal error: boost/lambda/lambda.hpp: No such file or directory
compilation terminated.
make[2]: *** [TESTCODE.o] Error 1
Makefile:398: recipe for target 'TESTCODE.o' failed
make[1]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/daniele/workspace/TESTCODE/src'
make: *** [all] Error 2
Makefile:403: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/home/daniele/workspace/TESTCODE'
Makefile:335: recipe for target 'all' failed

08:13:11 Build Finished (took 84ms)

错误:

  

描述资源路径位置类型致命错误:   boost / lambda / lambda.hpp:没有这样的文件或   目录TESTCODE.cpp / TESTCODE / src第11行C / C ++问题make: *   [全部]错误2 TESTCODE C / C ++问题make 1:* [all-recursive]   错误1 TESTCODE C / C ++问题make [2]:*** [TESTCODE.o]错误   1 TESTCODE C / C ++目标&#39;全递归&#39;   Makefile / TESTCODE失败行403 C / C ++目标的问题配方   &#39;所有&#39; Makefile / TESTCODE失败335 C / C ++问题配方   目标&#39; TESTCODE.o&#39; Makefile / TESTCODE第398行C / C ++失败问题

0 个答案:

没有答案