Makefile找不到由macports安装的boost库

编程入门 行业动态 更新时间:2024-10-24 01:50:24
本文介绍了Makefile找不到由macports安装的boost库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚使用 sudo port install boost 安装了来自macports的boost 1.42.0。

I just installed boost 1.42.0 from macports using sudo port install boost.

一切都很好。现在我有一个项目,我试图使用makefile。一切构建正常,直到它涉及到需要boost库的文件。

Everything worked fine. Now I have a project that I'm trying to build using a makefile. Everything builds fine until it comes to the file that needs the boost library.

它说: src / graph.h:20:42:错误:boost / graph / adjacency_list.hpp:没有这样的文件或目录

It says: src/graph.h:20:42: error: boost/graph/adjacency_list.hpp: No such file or directory

该文件实际位于两个地方: /opt/local/include/boost/graph/adjacency_list.hpp 和 /opt/local/var/macports/software/boost/1.42.0_0/opt/local/include/boost/graph/adjacency_list.hpp

That file is actually located in two places: /opt/local/include/boost/graph/adjacency_list.hpp and /opt/local/var/macports/software/boost/1.42.0_0/opt/local/include/boost/graph/adjacency_list.hpp

在文件src / graph.h中,它正在寻找boost / graph / adjacency_list.hpp,include语句在这里: #include< boost / graph /adjacency_list.hpp>

In the file src/graph.h where it's looking for boost/graph/adjacency_list.hpp, the include statement is here: #include<boost/graph/adjacency_list.hpp>

如何使这项工作?

推荐答案

您需要告诉编译器Boost的基本目录。您可以使用编译器的 -I 命令行选项:

You need to tell the compiler the base directory where Boost is intalled. You can do that with the compiler's -I command line option:

g++ -I/opt/local/include ...

更多推荐

Makefile找不到由macports安装的boost库

本文发布于:2023-10-13 09:52:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1487619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   Makefile   boost   macports

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!