From: neil on
I have been trying to compile a program that uses Xlib.h.

One of the source files has #include <X11/Xlib.h>

I searched the system and found xlib.h is in /usr/local/include/X11.
Despite this, the compiler says xlib.h no such file or directory. I tried
changing the #include to the full path name - but it just leads to errors
further down the line.

Can anyone see what I am doing wrong? Why does the compiler not see
xlib.h?? How can I fix this?
From: Måns Rullgård on
neil <invalid(a)invalid.net> writes:

> I have been trying to compile a program that uses Xlib.h.
>
> One of the source files has #include <X11/Xlib.h>
>
> I searched the system and found xlib.h is in /usr/local/include/X11.
> Despite this, the compiler says xlib.h no such file or directory. I tried
> changing the #include to the full path name - but it just leads to errors
> further down the line.
>
> Can anyone see what I am doing wrong? Why does the compiler not see
> xlib.h?? How can I fix this?

-I/usr/local/include

--
M�ns Rullg�rd
mans(a)mansr.com
From: neil on
Måns Rullgård <mans(a)mansr.com> wrote:
> neil <invalid(a)invalid.net> writes:
>
>> I have been trying to compile a program that uses Xlib.h.
>>
>> One of the source files has #include <X11/Xlib.h>
>>
>> I searched the system and found xlib.h is in /usr/local/include/X11.
>> Despite this, the compiler says xlib.h no such file or directory. I
> > tried
>> changing the #include to the full path name - but it just leads to
> > errors
>> further down the line.
>>
>> Can anyone see what I am doing wrong? Why does the compiler not see
>> xlib.h?? How can I fix this?
>
> -I/usr/local/include
Thank you I will make sure the path is in the linker setting of my IDE.
From: Scott Lurndal on
neil <invalid(a)invalid.net> writes:
>Måns Rullgård <mans(a)mansr.com> wrote:
>> neil <invalid(a)invalid.net> writes:
>>
>>> I have been trying to compile a program that uses Xlib.h.
>>>
>>> One of the source files has #include <X11/Xlib.h>
>>>
>>> I searched the system and found xlib.h is in /usr/local/include/X11.
>>> Despite this, the compiler says xlib.h no such file or directory. I
>> > tried
>>> changing the #include to the full path name - but it just leads to
>> > errors
>>> further down the line.
>>>
>>> Can anyone see what I am doing wrong? Why does the compiler not see
>>> xlib.h?? How can I fix this?
>>
>> -I/usr/local/include
>Thank you I will make sure the path is in the linker setting of my IDE.

that won't help. -I is for the compiler, not linker.

for the linker, you'll need -L/usr/local/lib, before the -lX11.

scott
From: Vladimir Jovic on
Scott Lurndal wrote:
> neil <invalid(a)invalid.net> writes:
>> Måns Rullgård <mans(a)mansr.com> wrote:
>>> neil <invalid(a)invalid.net> writes:
>>>
>>>> I have been trying to compile a program that uses Xlib.h.
>>>>
>>>> One of the source files has #include <X11/Xlib.h>
>>>>
>>>> I searched the system and found xlib.h is in /usr/local/include/X11.
>>>> Despite this, the compiler says xlib.h no such file or directory. I
>>>> tried
>>>> changing the #include to the full path name - but it just leads to
>>>> errors
>>>> further down the line.
>>>>
>>>> Can anyone see what I am doing wrong? Why does the compiler not see
>>>> xlib.h?? How can I fix this?
>>> -I/usr/local/include
>> Thank you I will make sure the path is in the linker setting of my IDE.
>
> that won't help. -I is for the compiler, not linker.
>
> for the linker, you'll need -L/usr/local/lib, before the -lX11.

For every normal distro, you just need -lX11. No need for including that
path (for compiling or linking).
Or am I wrong?
 |  Next  |  Last
Pages: 1 2 3
Prev: edge-triggered epoll, socket reading
Next: curses