This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Compiling Lesstif on Cygwin


Brian,

Thanks for taking time to reply to my email about 
Compiling Lesstif on Cygwin. Thanks for referring me
to the cygwin-xfree mailing list.

I've tried quite a few things since I posted the email
you answered.

I reinstalled the lesstif version you recommended and
verified the compiler string you suggested is what I use.

Having done those things, I get the following error:

	undefined reference to '_XtVaAppInitialize'

Do you know what's happening?

Gary

Here is the program (the first motif program in the O'Reilly book):

#include <Xm/Xm.h>
#include <Xm/PushB.h>

main(argc, argv)
char *argv[];
{
    Widget        toplevel, button;
    XtAppContext  app;
    void i_was_pushed();
    XmString label;

    toplevel = XtVaAppInitialize(&app, "Hello", NULL, 0,
        &argc, argv, NULL, NULL);

    label = XmStringCreateSimple("Push here to say hello"); 
    button = XtVaCreateManagedWidget("pushme",
        xmPushButtonWidgetClass, toplevel,
        XmNlabelString, label,
        NULL);
    XmStringFree(label);
    XtAddCallback(button, XmNactivateCallback, i_was_pushed, NULL);

    XtRealizeWidget(toplevel);
    XtAppMainLoop(app);
}

void
i_was_pushed(w, client_data, cbs)
Widget w;
XtPointer client_data;
XmPushButtonCallbackStruct *cbs;
{
    printf("Hello Yourself!\n");
}

The compiler string:

gcc -I/usr/X11R6/include -L/usr/X11R6/lib \
-lXm -lXt -lX11 hello.c -o hello

-----Original Message-----
From: Brian Ford [mailto:ford@vss.fsi.com] 
Sent: Thursday, July 24, 2003 5:33 PM
To: Gary Nicholson
Cc: lesstif@lesstif.org
Subject: Re: Compiling Lesstif on Cygwin

On Sun, 20 Jul 2003, Gary Nicholson wrote:

>I've installed Cygwin on Windows XP. The X Server starts and runs with
>no errors.
>
>I installed lesstif-cygwin-0.93.8.
>
lesstif-0.93.41-1 is the "supported" package available via the normal
Cygwin setup installer at www.cygwin.com.  Please use it.

On Mon, 21 Jul 2003, Gary Nicholson wrote:

>I am going to move the header files back to their
>original location and keep exploring how to set the
>include path for g++.
>

This is basic C compiler stuff.  Add -I/usr/X11R6/include to the
compile line and -L/usr/X11R6/lib to the link line.

These sort of questions are probably better suited for
cygwin-xfree@cygwin.com.

Cygwin's reluctant lesstif maintainer.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]