当前位置: 技术问答>linux和unix
在RedLinux7.2上编译基于Motif的程序不知该如何配置环境?
来源: 互联网 发布时间:2015-02-01
本文导语: 我在测试基于Motif的小程序时,系统报头文件找不到。 程序如下test.c: #include main (int argc, char *argv[]) { Widget toplevel, button; XtAppContext app; void button_pushed(Widget, XtPointer, XtPointer); XmString label; Arg args[2]; XtSetLanguage...
我在测试基于Motif的小程序时,系统报头文件找不到。
程序如下test.c:
#include
main (int argc, char *argv[])
{
Widget toplevel, button;
XtAppContext app;
void button_pushed(Widget, XtPointer, XtPointer);
XmString label;
Arg args[2];
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaOpenApplication (&app, "Hello", NULL, 0, &argc, argv,
NULL,sessionShellWidgetClass, NULL);
label = XmStringCreateLocalized ("Push here to say hello");
XtSetArg(args[0], XmNlabelString, label);
button = XmCreatePushButton (toplevel, "pushme", args, 1);
XmStringFree (label);
XtAddCallback (button, XmNactivateCallback, button_pushed, NULL);
XtManageChild (button);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
void button_pushed (Widget widget, XtPointer client_data, XtPointer call_data)
{
printf ("Hello Yourself!n");
}
我的编译命令:
gcc -W -o test test.c -L/usr/X11R6/lib -lXm -lXt -lX11
报错为:
Xm/PushB.h:No such file or directory
Xm的目录是个链接,实际情况为:
/usr/X11R6/include/Xm -> ../LessTif/Motif1.2/include/Xm
程序如下test.c:
#include
main (int argc, char *argv[])
{
Widget toplevel, button;
XtAppContext app;
void button_pushed(Widget, XtPointer, XtPointer);
XmString label;
Arg args[2];
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaOpenApplication (&app, "Hello", NULL, 0, &argc, argv,
NULL,sessionShellWidgetClass, NULL);
label = XmStringCreateLocalized ("Push here to say hello");
XtSetArg(args[0], XmNlabelString, label);
button = XmCreatePushButton (toplevel, "pushme", args, 1);
XmStringFree (label);
XtAddCallback (button, XmNactivateCallback, button_pushed, NULL);
XtManageChild (button);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
void button_pushed (Widget widget, XtPointer client_data, XtPointer call_data)
{
printf ("Hello Yourself!n");
}
我的编译命令:
gcc -W -o test test.c -L/usr/X11R6/lib -lXm -lXt -lX11
报错为:
Xm/PushB.h:No such file or directory
Xm的目录是个链接,实际情况为:
/usr/X11R6/include/Xm -> ../LessTif/Motif1.2/include/Xm
|
gcc -W -o test test.c -L/usr/X11R6/lib -lXm -lXt -lX11 -I/usr/X11R6/include
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。