[comp.sys.sgi] I think I'm going to go insane!

bagchi@eecs.umich.edu (Ranjan Bagchi) (05/31/91)

	Hi.  I'm working on a graphics project on an sgi, and have been
trying to use C++ (AT&T, until I build g++) for a system that works with
the 4sight graphics calls.

	It's not working.

	Assuming that I have a "normal" set-up, I took the program
ocatahedron, found in ~4Dgifts/examples/glpg/ch02/octahedron.c, which works
fine when compiled with cc and the required libraries, and compiled it with
CC (the C++ compiler).  I get a  blank window, and "ERROR #4  ortho:
ERR_BADWINDOW" on my tty.  I'm assuming that this is a bad thing, since
I don't know where documentation for error messages goes.

	I snagged the C file, translated by cfront, did some sed'ing
to minimize the differences between the two files, commented out the
call to _main(), compiled with cc, and the problem is still there.
 
	As far as I can tell, there aren't any differences between the
two files.  I put absolute paths in the #includes, to make sure the
same headers were getting included, and such, changed the variables
back to the way they were originally, and as far as I can tell, the
only differences between the original main(), and the cfronted main()
is tabs, and resolved macros.  I still get errors and a blank window.
 
	Help?  Does anyone have C++ code using gl calls which works?
 
	-rj

	
--
--------------------------------------------------------------------------------
Ranjan Bagchi - asleep......  |    v,i,j,k,l,s,a[99];
bagchi@eecs.umich.edu         |    main()   {
-------------------------------       for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i]) ;
					}  /* Osovlanski and Nissenbaum */
--------------------------------------------------------------------------------

robertl@cwi.nl (06/02/91)

In <BAGCHI.91May31102827@dip.eecs.umich.edu>, Ranjan Bagchi writes :

> I'm working on a graphics project on an sgi, and have been
> trying to use C++ (AT&T, until I build g++) for a system that works with
> the 4sight graphics calls.
> ....
> I get a  blank window, and "ERROR #4  ortho: ERR_BADWINDOW" on my tty.
> ....

It's a parameter passing problem. To use the GL with ATT C++, compile 
your source with (at least) the following compilation flags :

		+a1 -prototypes

See the manual pages for the meaning of these flags.


-- Robert van Liere


--------------------------------------------------
Robert van Liere, Department of Interactive Systems,
Center for Mathematics and Computer Science (CWI)
Kruislaan 413,  1098 SJ  Amsterdam,  The Netherlands
email: robertl@cwi.nl | tel: +31-20-592-4053 | fax: +31-20-592-4199