Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!hplabs!hpl-opus!hpcc05!hpsciz!masa From: masa@hpsciz.sc.hp.com (Masayoshi Habu) Newsgroups: comp.lang.c++ Subject: Re: C++ and X Message-ID: <1410005@hpsciz.sc.hp.com> Date: 20 May 91 16:44:48 GMT References: <202@yak.COM> Organization: Hewlett-Packard, Santa Clara, CA Lines: 28 In comp.lang.c++, sag5004@yak.COM (Stuart Galt) writes: My problem seem to be that c++ is very picky about argument types and likes all of the functions to be prototyped eg //extern Widget XtInitialize(); // /* String name; */ // /* String class; */ // /* XrmOptionsDescRec options; */ // /* Cardinal num_options; */ // /* Cardinal *argc; */ // /* char **argv; */ This seems to kind of work... extern Widget XtInitialize( String, String, XrmOptionDescRec, Cardinal, Cardinal*, char**); This is true and I love this strong type checking in C++. X11R4 header files are crafted to meet this function prototyping needs. So as long as you use X11R4, you don't need to create all the function prototypings. However you may need to rename things like "class" to something else because it is a reserved keyword in C++. There are occasions where a structure field is named as "class" in X11R4 header files. Also keep your eyes on the word "new" which is another reserved word in C++. I have done lots of programming in C++ with X and Motif. Masa Habu