Has anyone here ever used the GLwDrawingArea widget for Xt? I’m still pretty new to Xt, but I know my way around a compiler pretty well, but haven’t been able to get a linker error fixed yet.
Here’s a bit of the code I’m using, which is based on a simple Xt tutorial I found that I am trying to add a GL widget to.
int main(int argc, char** argv)
{
Widget toplevel, form, w, gl;toplevel = XtOpenApplication(&app_context, "XFirst", NULL, 0, &argc, argv, NULL, applicationShellWidgetClass, NULL, 0); form = XtVaCreateManagedWidget("form", formWidgetClass, toplevel, NULL); //w = XtVaCreateManagedWidget("quit_button", commandWidgetClass, form, // XtNlabel, "Quit", NULL); w = XtVaCreateManagedWidget("quit_button", commandWidgetClass, form, NULL); gl = XtVaCreateManagedWidget("gl_test", glwDrawingAreaWidgetClass, form, GLwNrgba, True, NULL); //gl = GLwCreateMDrawingArea(form, "gl_test", NULL, 0);
XtAddCallback(gl, GLwNexposeCallback, GLDisplay, NULL); XtAddCallback(gl, GLwNresizeCallback, GLResize, NULL); XtAddCallback(gl, GLwNginitCallback, GLInit, NULL); XtAddCallback(w, XtNcallback, quit_proc, NULL); XtRealizeWidget(toplevel); XtAppMainLoop(app_context);
return 0;
}
The compile line looks like so:
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -L/usr/X11R6/lib/modules/extensions -l
Xt -lXaw -lGL -lGLU -lGLw -lX11 -lm -lXext -lXm -o xtgltest xtgltest.c
/tmp/ccsd65f1.o(.text+0x86): In functionmain': : undefined reference to
glwDrawingAreaWidgetClass’
collect2: ld returned 1 exit status
make: *** [xtgltest] Error 1
And I did a grep to find which library glwDrawingAreaWidgetClass was found in like so:
grep glwDrawingAreaWidgetClass /usr/X11R6/lib/*
Binary file /usr/X11R6/lib/libGLw.a matches
I only have a .a library for libGLw, and no .so, could that have anything to do with it? Is there some additional command-line parameter I need to give to gcc for it to use .a libraries?
My system is running Slackware 9.1, gcc v3.2.3, and the nVidia Linux drivers with a GeForce 2 MX.