Makefile文件无法找到安装MacPorts的Boost库 [英] Makefile can not find boost libraries installed by macports

查看:184
本文介绍了Makefile文件无法找到安装MacPorts的Boost库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是用 sudo的港口安装升压安装升压1.42.0从MacPorts的

一切正常。现在,我有我尝试使用生成文件生成一个项目。直到它需要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:错误:升压/图形/ 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它在寻找升压/图形/ adjacency_list.hpp,include语句是在这里:结果
    #包括LT&;升压/图/ 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>

我如何使这项工作?

推荐答案

您需要告诉编译器升压龙头安装的基本目录。你可以做到这一点与编译器的 -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库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆