LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-13-2006, 07:31 AM   #1
nesta
Member
 
Registered: Aug 2006
Posts: 100

Rep: Reputation: 15
Xlib problem


I m using a program that uses Xlib so when I tried to compile it.There was a problem in including the following header:
Code:
#include <X11/Xlib.h>
the error is :
Code:
X11/Xlib.h no such file or directory.
I searched where is The file of Xlib.h I found only one file by this name,so when I changed the path I got a lot of errors these are the 3 types of errors I have got:


error type 1:
Code:
/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h:8: error: parse error before '*' token
error type 2:

Code:
/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h:9: error: parse error before "_ANSI_ARGS_"
error type 3:

Code:
/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h:11: error: parse error before "XInternAtom"
I m using linux SUSE 9.2
Can anyone tell me what should I do?
thanks
 
Old 10-13-2006, 08:08 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
There should be an Xlib.h in /usr/include/X11 or /usr/X11R6/include/X11 or /usr/X11R7/include/X11 that was installed by the x-server. I'm guessing that is the one that you need.

What program are you trying to build? What distro are you using?
 
Old 10-16-2006, 01:42 PM   #3
nesta
Member
 
Registered: Aug 2006
Posts: 100

Original Poster
Rep: Reputation: 15
[HTML]There should be an Xlib.h in /usr/include/X11 or /usr/X11R6/include/X11 [/HTML]



I already have that path (/usr/X11R6/include)but it does not contain Xlib.h
so Is there any suggestion cause up till now I cant use Xlib
 
Old 10-16-2006, 06:05 PM   #4
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
I already have that path (/usr/X11R6/include)but it does not contain Xlib.h
so Is there any suggestion cause up till now I cant use Xlib
could it be that you dont have the X development stuff installed? just a guess, or that file could just be located somewhere else.. as was asked eralier, what distro are you running? also did you try using locate or find?
 
Old 10-16-2006, 06:45 PM   #5
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Do you have Xlib.h anywhere on your system? You may need to put a copy in both paths that I mentioned.
 
Old 10-16-2006, 07:37 PM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
Originally Posted by Arow
Do you have Xlib.h anywhere on your system? You may need to put a copy in both paths that I mentioned.
there really is no need to copy that single file to an alternate location. if that file is missing then there is probably a whole list of headers that need to be installed with that file.. if that file is just in a different location that is expected, then you need to adjust accordingly in the build process.

imo, just randomly copying files around to fufill dependencies at that time will only cause more confusion down the road..
 
Old 10-17-2006, 07:53 AM   #7
nesta
Member
 
Registered: Aug 2006
Posts: 100

Original Poster
Rep: Reputation: 15
[HTML]what distro are you running[/HTML]

what does it mean?

when I searched for Xlib.h I found it in the following path:

[HTML]/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h[/HTML]

only in this path.
but I have got a lot of errors ,during compiling ,as I mentioned before like the following:

Code:
/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h:8: error: parse error before '*' token
[HTML]could it be that you dont have the X development stuff installed[/HTML]

how should I know it is installed or not?
please help
thanks
 
Old 10-17-2006, 10:59 AM   #8
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
> what does it mean?
are you using fedora core, slackware, ubuntu, etc, etc, etc

> /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi/Tk/pTk/Xlib.h
that may work, but would not be adviseable to include from that location.

>how should I know it is installed or not?
well depending on the distro you are using, you may just have to throw the install discs back in an click an option to install x development headers and libs. this is one reason everyone has been asking about the distro..
 
Old 10-17-2006, 11:04 AM   #9
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
what distro are you running?
You are using SuSE 9.2 as you originally posted and xhi and I both missed. I assume that you are using a GUI like KDE or GNOME and, therefore, have X Windows. Unless SuSE installs X Windows in some odd location, it is likely that you don't have the Xlib.h from X Windows.

As xhi mentioned, you'll need the development files (i.e., the headers) for X. They can probably be installed using the SuSE 9.2 package manager. Using the package manager *should* put the headers in either /usr/include/X11 or /usr/X11R6/include/X11.

Also, what package are you trying to build and is it available via the SuSE 9.2 package manager?
 
Old 10-17-2006, 11:12 AM   #10
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
Originally Posted by Arow
You are using SuSE 9.2 as you originally posted and xhi and I both missed.
nesta,
apologies. i did not see that you said Suse at in the first post as Arow has pointed out.. oops

Arow has detailed what i was getting at.. check your install discs..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xlib problem alokagrawal Linux - Newbie 1 09-27-2006 02:35 AM
XLib problem (XSendEvent) muratungor Programming 0 07-26-2005 07:34 AM
Xlib problem trican Linux - Newbie 5 10-23-2004 08:32 AM
Problem with locales with Xlib qmm Linux - General 0 03-05-2004 09:53 AM
Xlib problem aeruzcar Linux - General 4 10-31-2003 05:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration