LinuxQuestions.org
Help answer threads with 0 replies.
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 09-01-2009, 10:14 AM   #1
vipul jain
LQ Newbie
 
Registered: Nov 2008
Location: bhilwara(Rajasthan),India
Distribution: ubuntu
Posts: 5

Rep: Reputation: 0
Question how to use g++ to compile x11 programs


hi,
i have started a small project on pay roll management system.
so i am using 'X window system' for GUI with c++ coding.When i compile using g++ i got errors related to x11.i have included various x11 headers in my code like xlib.h ,xutil.h etc.i am using Ubuntu 8.10.
i have to use x11 without any toolkit and must do in c++.So PLEASE help me.

Thanks in advance.
 
Old 09-01-2009, 10:33 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by vipul jain View Post
hi,
i have started a small project on pay roll management system.
so i am using 'X window system' for GUI with c++ coding.When i compile using g++ i got errors related to x11.i have included various x11 headers in my code like xlib.h ,xutil.h etc.i am using Ubuntu 8.10.
i have to use x11 without any toolkit and must do in c++.So PLEASE help me.

Thanks in advance.
I guess most of us here do not possess telepathic abilities and thus can't:
  1. see your source code;
  2. see compiler error messages.
 
Old 09-01-2009, 12:48 PM   #3
vinay_s_s
Member
 
Registered: Jul 2003
Posts: 659

Rep: Reputation: 30
You probably need to link the x11 libraries .. -lX11 etc, and also point gcc to the right location of the headers... with -I/path/to/X-headers

If the libraries are in non-standard location, pass the location of the libraries with -L/path/to/libs

Oh and install the x development packages (i.e., the -devel packages in your distribution mostly)
 
Old 09-02-2009, 02:54 AM   #4
lorebett
Member
 
Registered: May 2004
Location: Italy
Distribution: Ubuntu, Gentoo
Posts: 57

Rep: Reputation: 16
you may also want to take a look at pkg-config (http://pkg-config.freedesktop.org/wiki/) which is a very valuable tools when working with other libraries (and also when libraries and headers are not installed in a standard location).
 
Old 09-02-2009, 04:15 AM   #5
mythcat
Member
 
Registered: Dec 2007
Location: Fălticeni, Romania
Distribution: Debian;Fedora
Posts: 77
Blog Entries: 1

Rep: Reputation: 15
video tutorial compile C on X11

On http://tv.free-tutorials.org you see video tutorial with name:
"Compile OpenGl with gcc on linux" maybe use this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
What X11 libraries do I need to compile Bochs? keyboard Linux - Software 1 04-18-2007 03:47 PM
cant compile pmars 0.9.5 (x11 problem?) minibootsy Other *NIX 0 08-28-2005 10:17 PM
Sudo and X11 programs 65_289 Linux - Software 1 05-17-2005 08:42 PM
X11 Won't compile Gentoo-2.6.10 skip1 Linux - Software 9 02-19-2005 05:15 PM
can't run X11 programs from xterm Sin-D Linux - General 4 12-18-2003 11:55 AM

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

All times are GMT -5. The time now is 06:48 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