Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OSX Lion/X11/CImg Library

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.

like image 266
user1782677 Avatar asked Jun 09 '13 03:06

user1782677


1 Answers

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

enter image description here

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

like image 147
trojanfoe Avatar answered Oct 20 '22 01:10

trojanfoe