![](/img/trans.png)
[英]How do I bundle the Allegro library with a Ubuntu Allegro application?
[英]How do I add Allegro (or any library) to the header include path on Mac?
使用Linux时,我对Allegro没问题,但是我不知道如何在OS X上包含该库。我最初是从源代码构建的,但是我卸载了该库以尝试MacPorts版本。 标头当前位于/opt/local/include/allegro5/
。
我不能使用#include <allegro5/allegro.h>
或
#include "/opt/local/include/allegro5/allegro.h"
。
基于编译错误,我认为Allegro标头通过以下方式相互引用
#include <allegro5/other_header.h>
。
那么,如何将allegro5目录添加到gcc / g ++的包含路径中?
谢谢!
根据本文中的数据,看起来正确的包含路径为/opt/local/include
。 当gcc / g ++尝试#include <allegro5 / allegro.h>时,它将在列表中将相对路径添加到基本包含路径,以便最终形成字符串/opt/local/include/allegro5/allegro.h
,其中它将找到一个正确的文件。
如果您使用gcc / g ++通过命令行进行编译,请添加选项-I/opt/local/include
。 如果您使用的是Xcode,那么我对此并不熟悉,但是我相信您需要深入研究项目的设置,并找到一个UI小部件,该部件允许您添加其他包含路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.