[comp.windows.x] Help needed on Athena Widgets

cchang@evax.arl.utexas.edu (Cheng-yaw Chang) (03/08/91)

I am new to the WCL which I recently received, and I am having problems
debugging my program.  One of the things that I am trying to do is run
the Athena intepreter from another program and create text widgets.  But
I have to set my environemnt before I can create the widget.  I can set
my XENVIRONMENT to my resource file in my shell, but when I try to do
that in my program by using the 
	putenv(string)
command, it gives me a segmentation fault.  The machine I'm using is the
Sun 3.  

If anyone has any information on how I can set my environment, your
help is greatly needed and appreciated.

Thanks 
Cheng-Yaw Chang

gildea@expo.lcs.mit.EDU (Stephen Gildea) (03/09/91)

    I can set my XENVIRONMENT to my resource file in my shell,
    but when I try to do that in my program by using the 
	    putenv(string)
    command, it gives me a segmentation fault.


Perhaps you are calling putenv with an automatic variable?  The string
you pass to putenv must stay around forever.  Well, not quite forever;
check the Sun man page for details.

 < Stephen
   MIT X Consortium