Re: Correction: Seg fault when calling Fortran from C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/31/2010 7:49 AM, Glenn H Sembroski wrote:
Opps, I left a BIND(C) in my fortran code snippet that shouldn't be there (I was trying this and that unsuccessfully to fix the problem. The corrected problem description follows: *****************************************************************************************

Hi all,
I am having a problem where I get a segfault when my C++ main program calls a f77 entry point. I am using GCC4.1.2. The C++ is compiled with g++, the fortran with gfortran. I use the -ffixed-line-length-none -fno-automatic -fno-underscoring -fbounds-check options with gfortran.
    ENTRY RLUXGO(LUX,INS,K1,K2)



I have stepped through this with gdb and the segfault occurs when I step into the rluxgo call . These files compiled and built with no problems. I have also compiled and built these same files using the Intel fortran compiler. That program ran with no problems.
Do I need a later version of GCC? Is there something else I need to do?
Thanks,

bind(c) would be a better approach, but you would need a more current gfortran, for sure. legacy usage of ENTRY incurs many possible abuses, such as an expectation of all variables default SAVE without so specifying.
-fno-automatic might compensate for missing SAVE, but also may not.

--
Tim Prince


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux