Mac OSX Lion/X11/CImg Library

断了今生、忘了曾经 提交于 2019-12-10 02:36:48

问题


So I'm trying to incorporate the CImg image writing library into my XCode project However, the header file for the library contains the following include and XCode gives this error warning:

#include <X11/Xlib.h>  Error: File not found

My laptop is running OSX Lion 10.8.2 and apparently, apple took away X11 for Lion, so I went on this site and downloaded XQuartz because that's what it said to do on the Apple Support page.

So after the installation, I restarted my computer and tried to run my XCode project, but I'm still getting the same exact error on that include.

So I'm not sure what I should do now to fix this. If I search in finder for "XLib.h", it appears and I have a folder called X11 which appears in my finder as well, so I feel like I probably have what I need but I can't figure it out.


回答1:


The header file Xlib.h is in /opt/X11/include, so add that path to the Header Search Paths in Xcode:

You'll probably need to add libraries from /opt/X11/lib as well...



来源:https://stackoverflow.com/questions/17006245/mac-osx-lion-x11-cimg-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!