This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
newbie xhello.c question
- From: "David Andersen" <dandersen at compuserve dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Sat, 27 Sep 2003 20:17:00 -0500
- Subject: newbie xhello.c question
- Reply-to: cygwin-xfree at cygwin dot com
(apologies if this is a duplicate post - I originally posted at 11:30 AM,
and
haven't seen it come thru yet)
I've just downloaded cygwin and am trying to get an Xwidget hello program
to compile + run.
With the following Imakefile and xhello.c, I get the following when I do
"xmkmf", "make". Is there something I haven't set up?
$ make
gcc xhello.o -o xhello
xhello.o(.text+0x65):xhello.c: undefined reference to `_XtVaAppInitialize'
xhello.o(.text+0x70):xhello.c: undefined reference to `_labelWidgetClass'
xhello.o(.text+0x88):xhello.c: undefined reference to
`_XtVaCreateManagedWidget'
xhello.o(.text+0x90):xhello.c: undefined reference to `_XtRealizeWidget'
xhello.o(.text+0x9b):xhello.c: undefined reference to `_XtAppMainLoop'
collect2: ld returned 1 exit status
make: *** [xhello] Error 1
------------- Imakefile ---------------------------------
LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
SRCS = xhello.c
OBJS = xhello.o
PROGRAMS = xhello
all:: $(PROGRAMS)
ComplexProgramTarget(xhello)
------------- xhello.c ---------------------------------
/*
* xhello.c - simple program to put up a banner on the display
*/
/*
* Include files required for all Toolkit programs
*/
#include <X11/Intrinsic.h> /* Intrinsics Definitions*/
#include <X11/StringDefs.h> /* Standard Name-String definitions*/
/*
* Public include file for widgets we actually use in this file.
*/
#include <X11/Xaw/Label.h> /* Athena Label Widget */
main(argc, argv)
int argc;
char **argv;
{
XtAppContext app_context;
Widget topLevel, hello;
topLevel = XtVaAppInitialize(
&app_context, /* Application context */
"XHello", /* Application class */
NULL, 0, /* command line option list */
&argc, argv, /* command line args */
NULL, /* for missing app-defaults file */
NULL); /* terminate varargs list */
hello = XtVaCreateManagedWidget(
"hello", /* arbitrary widget name */
labelWidgetClass, /* widget class from Label.h */
topLevel, /* parent widget */
NULL); /* terminate varargs list */
/*
* Create windows for widgets and map them.
*/
XtRealizeWidget(topLevel);
/*
* Loop for events.
*/
XtAppMainLoop(app_context);
}