简体   繁体   English

如何修复“致命错误:boost/asio.hpp:没有这样的文件或目录”?

[英]How to fix "fatal error: boost/asio.hpp: no such file or directory"?

I have installed boost using homebrew and it was working before I followed some steps to try and get gdb debugger working but now after I followed the steps and restarted, I can't even compile my program.我已经使用自制软件安装了 boost 并且在我按照一些步骤尝试让 gdb 调试器工作之前它正在工作,但是现在在我按照这些步骤重新启动后,我什至无法编译我的程序。 I have googled all over the place for the last 2 hours and I cannot figure this out.在过去的 2 个小时里,我在整个地方用谷歌搜索,但我无法弄清楚这一点。

I have tried uninstalling and reinstalling boost and anything else that I could find on google or stackoverflow but nothing is working and I have an assignment due tomorrow night and I am freaking out.我试过卸载并重新安装 boost 以及我可以在 google 或 stackoverflow 上找到的任何其他东西,但没有任何效果,我明天晚上有任务要交,我吓坏了。

Exact error:确切的错误:

fatal error: boost/asio.hpp: No such file or directory
 #include <boost/asio.hpp>
          ^~~~~~~~~~~~~~~~
compilation terminated.

I have tried compiling a number of ways including:我尝试过编译多种方法,包括:

g++ -g -I /usr/local/Cellar/boost/1.69.0 battleship_client.cc -lboost_system

You need to ensure the boost include path is passed into your compiler.您需要确保将 boost 包含路径传递到您的编译器中。

The boost lib path will need to be passed into to your linker.需要将 boost lib 路径传递给您的链接器。

Depending on your environment, you can do this with the system path variable, Visual Studio properties, or as compiler/linker flags.根据您的环境,您可以使用系统路径变量、Visual Studio 属性或作为编译器/链接器标志来执行此操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:C1083:无法打开包含文件:'boost/asio.hpp':没有这样的文件或目录 - error: C1083: Cannot open include file: 'boost/asio.hpp': No such file or directory 包括boost / asio.hpp抛出错误 - Including boost/asio.hpp throwing error CMake 错误:致命错误:如果不使用 find_package() 进行升压,则找不到 boost/asio.hpp - CMake Error: fatal error : boost/asio.hpp not found without using find_package() for boost 如何使用boost / asio.hpp文件g ++一个C ++程序? - How to g++ a C++ program using boost/asio.hpp file? 包含后无法运行程序<boost/asio.hpp> - Can't run program after including <boost/asio.hpp> 如何为C ++ Visual Studio 2015安装boost / asio.hpp库 - how to install boost/asio.hpp library for C++ visual studio 2015 致命错误:boost/filesystem.hpp:没有那个文件或目录 - fatal error: boost/filesystem.hpp: No such file or directory 如何修复 manjaro 中安装的 opencv4 的“致命错误:opencv2/core.hpp:没有这样的文件或目录” - How to fix “fatal error: opencv2/core.hpp: No such file or directory” for opencv4 installed in manjaro boost,c ++和致命错误:boost / random / uniform_int_distribution.hpp:没有此类文件或目录 - boost, c++ and fatal error: boost/random/uniform_int_distribution.hpp: No such file or directory 添加#include <boost/asio.hpp> 导致“有不同大小”的问题 - Adding #include <boost/asio.hpp> results in “has different size” problems
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM