How to troubleshoot build flags

Richard Shaw hobbes1069 at gmail.com
Tue Jun 10 16:12:54 UTC 2014


On Tue, Jun 10, 2014 at 11:07 AM, Andrew Schultz <ajschult at verizon.net>
wrote:

> Richard Shaw wrote:
>
>> /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/crt1.o: In
>> function `_start':
>> (.text+0x20): undefined reference to `main'
>> collect2: error: ld returned 1 exit status
>> rmbadname1: Replacing "len" with "len_bn".
>> /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/crt1.o: In
>> function `_start':
>> (.text+0x20): undefined reference to `main'
>> collect2: error: ld returned 1 exit status
>> error: Command "/usr/bin/gfortran -Wall -Wl,-z,relro -Wl,-z,relro
>> /tmp/tmpom3x2m/tmp/tmpom3x2m/src.linux-x86_64-3.3/wmodule.o
>> /tmp/tmpom3x2m/tmp/tmpom3x2m/src.linux-x86_64-3.3/fortranobject.o
>> /tmp/tmpom3x2m/wspr1.o /tmp/tmpom3x2m/getfile.o
>> /tmp/tmpom3x2m/paterminate.o /tmp/tmpom3x2m/audiodev.o
>> /tmp/tmpom3x2m/tmp/tmpom3x2m/src.linux-x86_64-3.3/w-f2pywrappers.o
>> thnix.o libwspr.a -L/usr/lib64 -lfftw3f -lgfortran -lportaudio -lpthread
>> -lsamplerate -lpython3.3m -lgfortran -o ./w.cpython-33m.so
>> <http://w.cpython-33m.so>" failed with exit status 1
>>
>> make: *** [WsprMod/w.so] Error 1
>>
>
> It's using the gfortran to link and then explicitly adding -lgfortran
> (twice, of course);  gfortran will do this automatically.  Also, if a
> executable has a main method in C, then you'll be more successful linking
> the program with gcc instead of gfortran (if it has a main program in
> fortran, then use gfortran to link).  It might be possible to go the other
> way, but I have never had success.


None of the very few c files define main so I'm guessing it's defined in
the fortran code.

Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20140610/155ed1b1/attachment.html>


More information about the devel mailing list