The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Xwindows amu UNIX Desktop for Dummies Questions & Answers 0 04-08-2008 06:51 AM
Xwindows amu Linux 0 04-08-2008 06:42 AM
xwindows over ssh after sudo? scottsl UNIX for Advanced & Expert Users 3 08-26-2006 12:54 AM
Xwindows on a HMC pagink AIX 5 06-21-2006 02:43 AM
XWindows on Mac OSX Alpha_Harblo UNIX for Dummies Questions & Answers 2 08-05-2001 10:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2005
Registered User
 

Join Date: Feb 2005
Posts: 40
XWindows

I have written some Xwindows files would like to know how to compile them
tried this command

gcc -o main main.o -lXt -lX11

gives errors like could not find Xt & X11

help please
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-17-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Compileis expecting where this libs are.

specify by -L option where Xt and X11 are.

It would be

gcc -o main main.o -lXt -lX11 -L$pathtoXt -L$pathtoX11
Reply With Quote
  #3 (permalink)  
Old 02-18-2005
Registered User
 

Join Date: Feb 2005
Posts: 40
Talking re

He He He Same Error buddy
Reply With Quote
  #4 (permalink)  
Old 02-19-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Can we have all compilation commands you have for
targets main and main.o ?
Reply With Quote
  #5 (permalink)  
Old 02-19-2005
Registered User
 

Join Date: Feb 2005
Posts: 40
Re

here is the program
main.c
1 #include <X11/Intrinsic.h>
2 #include <Xm/Xm.h>
3 #include <Xm/Label.h>
4
5 XtAppContext context;
6 XmStringCharSet char_set = XmSTRING_DEFAULT_CHARSET;
7 Widget toplevel,label;
8
9 main(argc,argv)
10 int argc;
11 char* argv[];
12 {
13 Arg a1[10];
14 int ac = 0;
15 toplevel = XtAppInitialize(&context,"",NULL,0,&argc,argv,NULL,NULL,0);
16 label = XmCreateLabel(toplevel,"label",a1,ac);
17 XtmanageChild(label);
18 XtrealizeWidget(toplevel);
19 Xtmainloop();
20 }

after this:

cc -c main.c

cc -o main main.o -lXt -lX11 -L$pathtoXt -L$pathtoX11

Last edited by wojtyla; 02-19-2005 at 10:31 AM.
Reply With Quote
  #6 (permalink)  
Old 02-19-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Quote:
-L$pathtoXt -L$pathtoX11
Did u literally put as above ?


Could you find out where Xt and X11 exists. Please find out where those libs exists and then attach -L.

They may be having names libXt* and libX11*.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0