This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
RE: Compiling Lesstif on Cygwin
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: cygwin-xfree at cygwin dot com, <holokine at holokine dot com>
- Date: Fri, 25 Jul 2003 14:03:14 -0400 (EDT)
- Subject: RE: Compiling Lesstif on Cygwin
- Reply-to: cygwin-xfree at cygwin dot com
- Reply-to: cygwin-xfree at cygwin dot com
Gary,
> The compiler string:
>
> gcc -I/usr/X11R6/include -L/usr/X11R6/lib \
> -lXm -lXt -lX11 hello.c -o hello
The above is a classic C beginner's mistake: the libraries go to the *end*
of the compile command, i.e., try
gcc -I/usr/X11R6/include -L/usr/X11R6/lib hello.c -o hello -lXm -lXt -lX11
Hope this helps,
Igor
On Fri, 25 Jul 2003, Gary Nicholson wrote:
> 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.
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton