|
|
#1 |
|
How to use X11 in XCode?
Hi everybody!
First, sorry if my english is bad, I'm french so I may do some mistakes! =) I'm a student, and my school gave me the source code of a program, written in C. I have to finish that one. But this program is using X11 libraries, and we don't have these libs on Mac OSX since 10.5 or 10.6 right? Whatever, my MBP is running on Mountain Lion, so I don't have these libs and XCode tells me: #include <X11/Xlib.h> -> X11/Xlib.h not found So I've installed XQuartz, but I've the same issue! =/ I've read something that I should make an "External Build System" project and use my own build tool or something like that, but I don't understand how to do this... (I tried to install CMake, but what should I do next?) Someone can explain me how to build my program? Thanks for your attention, and merry christmas for the next days! =) PS: Sorry again if my english is pretty bad |
|
|
|
0
|
|
|
#2 | |
|
Quote:
I don't use XCode, but another option would be to modify the path that XCode uses when searching for headers. You'll need to consult the XCode documentation, or wait for a more enlightened user to reply. |
||
|
|
0
|
|
|
#3 | |
|
Quote:
1. Selecting the Xcode project file in the Project Navigator (the left sidebar's folder icon) 2. Click the Build Settings tab 3. Find the "Header Search Paths" setting, and add /opt/X11/include |
||
|
|
0
|
|
|
#4 | |
|
Quote:
I'm puzzled/curious about what kind of programming exercise this is, that needs to include X11 headers. |
||
|
|
0
|
|
|
#5 | |
|
Thanks for answering me, XCode now loads the libs!
But I have a new problem : Quote:
So, does this means that my X11 libraries are wrong? (I don't think so) @LPZ: This is a program to smooth a picture. Last edited by Asuka'; Dec 23, 2012 at 08:45 AM. |
||
|
|
0
|
|
|
#6 | |
|
Quote:
|
||
|
|
0
|
|
|
#7 | |
|
Thanks, but this is not the file I need.
I don't think the issue is about a 32 or 64 bits version, I tried to compile my program in 32 bits and I get a similar error: Quote:
|
||
|
|
0
|
|
|
#8 | |
|
Quote:
|
||
|
|
0
|
|
|
#9 |
|
My program is made of several .c, but affichage.c is the only one that use X11 libs.
I don't know why XCode doesn't find the libs, I have added '/opt' recursively under LIBRARY SEARCH PATH to be sure that Xcode find them, but maybe I'm wrong! EDIT: I reached to make it worked, I need to add "-lX11" during the building. This works in the Terminal, but I can't find where add this option under XCode =/ Last edited by Asuka'; Dec 23, 2012 at 10:19 AM. |
|
|
|
0
|
|
|
#10 |
|
Look at additional linker flags. Or you could add the X11 library to the Xcode project and tell the project to link to it.
You might also need to set the library search path if you haven't already done that. |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 02:55 AM.







Linear Mode
