gcc-4.2 setting for gfortran

FX Coudert fxcoudert@gmail.com
Fri Jun 15 19:32:00 GMT 2007


>> In function `main':
>> /home/tob/projects/gcc-4_2-branch/libgfortran/fmain.c:18:  
>> undefined reference to
>> `MAIN__'
>> collect2: ld returned 1 exit status
>> On other server with this setting the compilation above works:
> I would guess that LD_LIBRARY_PATH environment variable is not set  
> right to point to where the new libraries are.

Hum, I don't think it's the reason for the problem there.  
LD_LIBRARY_PATH only affects runtime, and MAIN__ the main Fortran  
program as generated by the compiler.

Is your main program Fortran or C code? if it's Fortran, make sure  
the corresponding object file is indeed included in your final  
linking command-line. If it's C code, try linking with "gcc - 
lgfortran" instead of "gfortran".

Hope this helps, and please report back to us with this information  
if you need further advice.

FX



More information about the Fortran mailing list