[comp.windows.x] X, Motif, and C++ working together ?

haverlan@tramp.colorado.edu (HAVERLAND MARC BRADLEY) (02/19/91)

We are students at the University of Colorado, Boulder.  We are working on
a senior project that requires the use of c++, X Windows, and OSF/Motif.

Can you tell us where we can get all the header files for X and Motif to
be able to use gnu c++ (g++)?

any ftp site, phone number, address of person to talk to, etc. would be
most helpful.  

BTW, we are not even sure that we are asking for everything that we need.
If we are forgetting something, its because we simply don't know, not 
because we know we don't need it.  Basically, we need c++, X, and Motif to
be working together.

Thanks for your help.

Marc Haverland
haverlan@tramp.colorado.edu
303-650-1100

gwu@nujoizey.tcs.com (George Wu) (02/19/91)

-
     This is probably an frequently asked question, since a few people
complained when I asked a very similar question a month or so ago.  (Yes,
for those who asked me to send on the information I got, I will do so soon.
I just seem to always get distracted by another fire.)

     Anyways, if you're using GNU's g++, then things are a bit simpler.
You should be including Motif and X heder files in an extern "C" statement,
and this turns off argument checking.  Hence, you can just use the ordinary
header files without problems.  (There are a few other problems, such as the
use of "class" as a field within a struct, but these few remaining problems
are trivial.)

     For every other compiler of which I am aware, extern "C" only turns off
name mangling, not function argument type checking.  Hence, you will need
prototyped header files.  The easiest way to get such header files is to go
with Release Four of X11 and Motif 1.1.  If you can't do so, there are a few
projects out there which have added prototyping for the work they have done.
Included amongst such projects are:

	o WWL, a set of C++ classes to wrap X Toolkit Widgets, available via
	  anonymous FTP from expo.lcs.mit.edu (18.30.0.212);

	o X++, also a wrapper set of class available at the address below.
	  (There is FTP access available, but you're supposed to purchase a
	  liscense for $250 US first.):

		University of Lowell
		Graphics Research Laboratory/Motif
		Computer Science Department
		One University Avenue
		Lowell, MA 01854
		attn : Fran Ward
		(phone 508-934-3628);

	o THINGS, a class library written at the Rome Air Force Base by
	  the Strategic Air Command, available as freeware on some of the
	  public archives (Sorry, that's all I know.);

	o HP C++ 2.0 with Motif 1.0 (and therefore X11 [release three?])
	  header files (HP C++ 2.1 is supposed to ship any minute now, if
	  it hasn't already.);

	o HP-UX 8.0, not due out for a few more months, but you might be
	  able to get HP to lend you alpha/beta test a copy or some or all
	  of it (I tried briefly, but gave up when other courses proved
	  more fruitful.);

	o Saber C++ as X11 header files with prototypes, but I don't know
	  about Motif.

     Both the Saber C++ and HP-UX work might include prototyped header
files only because they are really upgrades to X11, Release Four, and/or
Motif 1.1.  I don't know, that's just my uneducated guess.


----
George J Wu, Software Engineer        | gwu@tcs.com or uunet!tcs!gwu
Teknekron Communications Systems, Inc.| (415) 649-3752
2121 Allston Way, Berkeley, CA, 94704 | Quit reading news.  Get back to work.