Prev: edge-triggered epoll, socket reading
Next: curses
From: neil on 24 Jun 2010 14:47 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 24 Jun 2010 14:54 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 24 Jun 2010 15:17 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 24 Jun 2010 19:26 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 25 Jun 2010 04:07
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? |