C++ 提升“没有这样的文件或目录”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12241152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 16:04:38  来源:igfitidea点击:

Boost "no such file or directory"

c++boostcodeblocks

提问by Matthew

I'm trying to set up my Code::Blocks work environment on a new computer and I'm having some problems. It's been a long time since I first did this, and now when I open my major project Boost is causing me problems.

我正在尝试在新计算机上设置我的 Code::Blocks 工作环境,但遇到了一些问题。自从我第一次这样做以来已经有很长时间了,现在当我打开我的主要项目时,Boost 给我带来了问题。

I'm fairly new to C++ still and fixing this type of problem is something I have limited experience with.

我对 C++ 还是相当陌生,解决这类问题是我经验有限的事情。

When I open my project and try to compile it, I get this error:

当我打开我的项目并尝试编译它时,我收到此错误:

fatal error: boost/algorithm/string.hpp: No such file or directory|

致命错误:boost/algorithm/string.hpp:没有那个文件或目录|

At this part of one of my header files:

在我的头文件之一的这一部分:

#include <boost/algorithm/string.hpp>

I placed the Boost v1.51.0 library at C:\boost since that is where I'd had it on my other computer. My project is set to search that directory for additional includes but it doesn't seem to be finding the files?

我将 Boost v1.51.0 库放在 C:\boost 中,因为那是我在另一台计算机上的位置。我的项目设置为在该目录中搜索其他包含但它似乎没有找到文件?

My project used an older version of Boost previously but I doubt that's an issue.

我的项目以前使用了旧版本的 Boost,但我怀疑这是一个问题。

I'm not sure how difficult it is to debug this problem with this limited information so if there's anything else I can provide please let me know.

我不确定用这些有限的信息来调试这个问题有多困难,所以如果我能提供任何其他信息,请告诉我。

I'm using Code::Blocks, and have just set up minGW and Visual C++ 2010.

我正在使用 Code::Blocks,并且刚刚设置了 minGW 和 Visual C++ 2010。

回答by Alfred Landik

In Ubuntu use

在 Ubuntu 中使用

sudo apt-get install libboost-dev

回答by Oscar Raig Colon

Ensure that you have installed boost-devel package

确保你已经安装了 boost-devel 包

In Centos execute as root:

在 Centos 中以 root 身份执行:

yum install boost-devel

then

然后

root@centos6 /]# find / -name boost
/usr/include/boost
/usr/lib64/boost
[root@centos6 /]#