[XForms] c++ xforms code segfaults

Robert Williams bob at bob.usuhs.mil
Tue Apr 28 15:34:48 CEST 2009

To subscribers of the xforms list

Dear Jens,

Yes, I did solve this problem, primarily by
including "-lgfortran" in my link list.   This is
probably not something of general interest,
but it does put a stress test on the xforms library,
linking C++, C, and Fortran libraries, that
it appears to have passed nicely. 

Here is the top of my Makefile:

CPP=g++ #-ggdb3
#CPP=gcc #
FC=gfortran #-ggdb3
LIBS= -I/usr/X11R6/include/X11 \
     -L/usr/X11R6/lib -lX11 -lXaw -lforms \
     -Lpgplot -lcpgplot -lpgplot \
     -lgfortran -lfftw3 -lm
FFLAGS=-c -I/usr/X11R6/include/X11 -I/usr/local/include
FCFLAGS=-c -ffixed-line-length-none -ff2c

The full source of this project, with screenshots, is at:
The executable produced
by the new XForms library does appear to have a few tics
that I'll have to sort out.


Jens Thoms Toerring wrote:
> To subscribers of the xforms list
> Hi Bon,
> On Wed, Apr 22, 2009 at 06:06:53PM -0400, Robert Williams wrote:
>> I'm trying to resurrect an XForms based package
>> of mine named XSpectra, written in mixed C++ and
>> Fortran.   The package was working once,
>> compiles and links without errors,
>> but segfaults before entering the main program:
>> (gdb) run
>> Starting program: /usr/local/src/xspectra_march_2009/xspectra
>> Program received signal SIGSEGV, Segmentation fault.
>> 0xb7fb03d7 in __do_global_dtors_aux ()
>> Current language:  auto; currently asm
>> Breakpoints don't help and backtrace shows only the
>> __do_global_dtors_aux () line above.    Does anyone on the list have
>> a small working C++ example, or any experience with this
>> situation?
> I haven't answered yet because I am not very well acquainted
> with C++ but I would of course be very interested if you could
> solve this problem already and if it had anything to do with
> the newer version of XForms. I tried to write an extremely
> simple C++ program using XForms (just calling fl_initialize()
> and  fl_finish() and with that I couldn't reproduce your pro-
> blem - but that, of course, doesn't prove anything...
>                             Best regards, Jens

Dr. Robert Williams
Department of Biomedical Informatics
Program in Molecular and Cell Biology
Faculty Senate Past President,
Phone: 301-295-3568

To unsubscribe, send any message to
xforms-leave at bob.usuhs.mil or see: 
List Archive: http://bob.usuhs.mil/pipermail/xforms and
XForms Home: http://savannah.nongnu.org/projects/xforms

More information about the Xforms mailing list