Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!pattersw From: pattersw@cs.rpi.edu (William Patterson) Newsgroups: comp.windows.x Subject: X & C++ (next round) Message-ID: <$JY$MG#@rpi.edu> Date: 20 Jul 90 04:25:42 GMT References: <8035@ncar.ucar.edu> Organization: RPI Computer Science Dept. Lines: 83 I recieved several replies to my first posting, but none that really solved the problem (compiling X & athena widgets with g++). Most of the responses started "Well, without more details I can't tell for sure..." So, in hopes that more details will aid some kind person in finding where I'm going wrong, here are the details... ------------ The Compile Command -------------------- g++ junk.c \ -fwritable-strings -fstrength-reduce -felide-constructors \ -fschedule-insns -fdelayed-branch -fsave-memoized \ -lXaw -lXmu -lXt -lXext -lX11 Note : I get the same errors using -ansi or -traditional in place of all the -f... flags (which I don't understand but which were suggested by somone via e-mail) ---------------- Errors Porduced --------------------- In file included from /usr/local/gnu/lib/g++-include/sys/time.h:3, from /usr/include/X11/Xos.h:121, from /usr/include/X11/Intrinsic.h:36, from junk.c:2: /usr/local/gnu/lib/g++-include/time.h:60: warning: type declaration of timezone shadowed In file included from junk.c:2: /usr/include/X11/Intrinsic.h:102: parse error before `char' junk.c:6: parse error before `fallback_resources' junk.c:6: warning: initialization of integer from pointer lacks a cast junk.c:6: warning: data definition lacks type or storage class junk.c:12: `argc' undeclared, outside of functions junk.c:12: `argv' undeclared, outside of functions junk.c:13: parse error before `int' junk.c:15: parse error before `{' junk.c:20: conflicting types for `toplevel' junk.c:21: warning: initialization of integer from pointer lacks a cast junk.c:21: warning: data definition lacks type or storage class junk.c:23: parse error before `void' junk.c:25: warning: data definition lacks type or storage class junk.c:26: warning: data definition lacks type or storage class junk.c:27: parse error before `}' Compilation finished at Fri Jul 20 00:10:00 --------------- The Program --------------------- #include #include #include #include String fallback_resources[] = { "*Label.Label: This is xlabel", NULL }; static XrmOptionDescRec options[] = { {"-label", "*Label.label", XrmoptionSepArg, NULL} }; main(argc, argv) int argc; char **argv; { static void Syntax(); XtAppContext app_con; Widget toplevel; toplevel = XtAppInitialize(&app_con, "Xlabel", options, XtNumber(options), &argc, argv, fallback_resources, NULL, ZERO); (void) XtCreateManagedWidget("label", labelWidgetClass, toplevel, NULL, ZERO); XtRealizeWidget(toplevel); XtAppMainLoop(app_con); } -------------------- END ----------------------------- -- ----------------------------------- Bill Patterson pattersw@turing.cs.rpi.edu Computer Science Department Rensselaer Polytechnic Institute Troy, NY. -----------------------------------