home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,908 of 5,127   
   Lynn McGuire to Lynn McGuire   
   Re: nasty link problem with Gfortran and   
   13 Jan 25 22:59:29   
   
   From: lynnmcguire5@gmail.com   
      
   On 1/7/2025 3:35 PM, Lynn McGuire wrote:   
   > I just ran into a nasty problem with GFortran and G++ (C++).  Probably   
   > not a bug ???  I am using GCC 14.1.   
   >   
   > I have a lot of code in C++ (over 100,000 lines).  I have 750,000 lines   
   > of code in GFortran.  I have to extern "C" this code in C++ to make it   
   > callable by GFortran code.   
   >   
   > I missed declaring a couple of C++ functions as extern "C" which means   
   > that they kept their C++ mangled link names.  But these C++ functions   
   > were declared as integer*8 and external in the GFortran code (old F77   
   > code).   
   >   
   > So, the GCC linker did not report to me that it did not have a link for   
   > the G++ functions.  This may be a bug, I am not sure.   
   >   
   > When I ran the program, the C++ functions were not called by the   
   > GFortran code.  Instead, the GFortran code treated the C++ functions as   
   > integer*8 scalar variables.   
   >   
   > If needful, I can probably put together a small code sample that   
   > exhibits the problem.  Maybe.  It could be that the size of my code   
   > affects the GCC linker.   
   >   
   > I removed the Gfortran code "external" keywords, extern "C" the C++   
   > functions, added the C++ function to my module list, and got a working   
   > link.   
   >   
   > Thanks,   
   > Lynn   
      
   I found and fixed the problem with my code along with one of my   
   programmers.  I was not properly handling the size_t hidden argument   
   length value that GFortran adds to the character string arguments in my   
   C++ code.  Things are going better now.   
      
   Thanks for all of the suggestions.  Sorry to bother you all with my issues.   
      
   Lynn   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca