当前位置: 技术问答>linux和unix
编译后运行为什么出现这个警告?
来源: 互联网 发布时间:2015-05-31
本文导语: 为什么出现警告: _XmGetDefaultDisplay can't be used prior to Vendors.Initialize,return NULL 代码片断如下: ProgExcutor_p shlProgEx = (ProgExcutor_p)NULL; XtAppContext app_context = (XtAppContext)0; Display *display = (Display*)0; void ProgExcutor::crea...
为什么出现警告:
_XmGetDefaultDisplay can't be used prior to Vendors.Initialize,return NULL
代码片断如下:
ProgExcutor_p shlProgEx = (ProgExcutor_p)NULL;
XtAppContext app_context = (XtAppContext)0;
Display *display = (Display*)0;
void ProgExcutor::create(Display *display,char* app_name,int app_argc,
char** app_argv,char* app_class_name)
{
shlProgEx = XtAppCreateShell(app_name,app_class_name,
overrideShellWidgetClass,display,al,ac);
pixmap = XmGetPixmap(...);
main_w = XmCreateMainWindow(shlProgEx,"main_window",al,ac);
......
}
int main(int argc, char **argv)
{ ......
XtToolkitInitialize();
app_context = XtCreateApplicationContext();
display = XtOpenDisplay(app_context,(string)0,argv[0],"XApplication",
(XrmOptionDescRec*)0,0,&argc,argv);
XmRepTypeInstallTearOffModelConverter();
shlProgEx = new ProgExcutor();
shlProgEx->create(display,argv[0],argc,argv,"XApplication");
XtRealizeWidget(shlProgEx->xd_rootwidget());
......
XtAppMainLoop(app_context);
exit(0);
}
_XmGetDefaultDisplay can't be used prior to Vendors.Initialize,return NULL
代码片断如下:
ProgExcutor_p shlProgEx = (ProgExcutor_p)NULL;
XtAppContext app_context = (XtAppContext)0;
Display *display = (Display*)0;
void ProgExcutor::create(Display *display,char* app_name,int app_argc,
char** app_argv,char* app_class_name)
{
shlProgEx = XtAppCreateShell(app_name,app_class_name,
overrideShellWidgetClass,display,al,ac);
pixmap = XmGetPixmap(...);
main_w = XmCreateMainWindow(shlProgEx,"main_window",al,ac);
......
}
int main(int argc, char **argv)
{ ......
XtToolkitInitialize();
app_context = XtCreateApplicationContext();
display = XtOpenDisplay(app_context,(string)0,argv[0],"XApplication",
(XrmOptionDescRec*)0,0,&argc,argv);
XmRepTypeInstallTearOffModelConverter();
shlProgEx = new ProgExcutor();
shlProgEx->create(display,argv[0],argc,argv,"XApplication");
XtRealizeWidget(shlProgEx->xd_rootwidget());
......
XtAppMainLoop(app_context);
exit(0);
}
|
没觉得有问题。什么系统?连接了什么库?是否是BUG?