From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9d739500858ba57d,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,9d739500858ba57d,start X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1993-05-25 18:31:05 PST Xref: gmd.de comp.unix.ultrix:9349 comp.sys.dec:7907 Newsgroups: comp.unix.ultrix,comp.sys.dec Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!gatech!hubcap!dpotlur From: dpotlur@hubcap.clemson.edu (Dora Potluri) Subject: Help on compiling Motif code with C++ Message-ID: <1993May26.011233.14929@hubcap.clemson.edu> Keywords: DEC Ultrix 4.2a, Motif 1.1.3, C++ 1.2 Organization: Clemson University Date: Wed, 26 May 1993 01:12:33 GMT Configuration: ----------------- DEC Ultrix 4.2a, Motif 1.1.3, C++ 1.2 Hello everyone, I am having trouble with compiling C++ code with OSF/Motif 1.1.3. The program is a very simple one and the compiler gives bunch of errors as soon as it sees the Xt code. I read CXX man pages and nothing is given as how to compile OSF/Motif code. Am I missing some thing? I would appreciate if can one can e-mail me on how to compile the code. Thanx a lot Potluri --------------------------------------------------------- ----------------------Errors------------------------------ --------------------------------------------------------- sparerib(329)% cxx -o hello hello.C -lXm -lXt -lX11 hello.C:41: error: In this statement, "XtAppInitialize(&app,"Hello",0,0, ...)" s upplies 9 arguments, but 0 are expected. hello.C:52: error: In this statement, "XtCreateManagedWidget("label",xmLabelWidg etClass,toplevel,args, ...)" supplies 5 arguments, but 0 are expected. hello.C:61: error: In this statement, "XtRealizeWidget(toplevel)" supplies 1 arg ument, but 0 are expected. hello.C:62: error: In this statement, "XtAppMainLoop(app)" supplies 1 argument, but 0 are expected. Compilation terminated with errors. --------------------------------------------------------- ----------------------Program------------------------------ --------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // This example code is from the book: // // Object-Oriented Programming with C++ and OSF/Motif // by // Douglas Young // Prentice Hall, 1992 // ISBN 0-13-630252-1 // // Copyright 1991 by Prentice Hall // All Rights Reserved // // Permission to use, copy, modify, and distribute this software for // any purpose except publication and without fee is hereby granted, provided // that the above copyright notice appear in all copies of the software. /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////// // hello.C, Hello World using C++ and Motif //////////////////////////////////////////////////////// #include #include #if (XlibSpecificationRelease>=5) void main ( int argc, char **argv ) #else void main ( unsigned int argc, char **argv ) #endif { Widget label, toplevel; XtAppContext app; XmString xmstr; Arg args[10]; int n; // Initialize the Intrinsics toplevel = XtAppInitialize ( &app, "Hello", NULL, 0, &argc, argv, NULL, NULL, 0 ); // Create a compound string to display the Hello message xmstr = XmStringCreateSimple ( "Hello World" ); // Create a label widget to display the string n = 0; XtSetArg ( args[n], XmNlabelString, xmstr ); n++; label = XtCreateManagedWidget ( "label", xmLabelWidgetClass, toplevel, args, n ); // Free the compound string when it is no longer needed. XmStringFree ( xmstr ); // Realize all widgets and enter the main event loop XtRealizeWidget ( toplevel ); XtAppMainLoop ( app ); } -- Potluri Dora Information Systems Lab Clemson University Clemson, sc 29631