Re: Compiler problem with gfortran

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

 



On Sun, 24 Apr 2022, 18:34 C. David Whiteman, <davidwhiteman@xxxxxxx> wrote:

> I got on the Apple Developer website and downloaded
>
> Command Line Tools for Xcode 13.3
> Additional Tools for Xcode 13.3
>
> But I am still getting the following error when coming skippy.f
>
> ~/Desktop 526 $ gfortran skippy.f
> ld: library not found for -lSystem
> collect2: error: ld returned 1 exit status
>
> I guess the ld: suggests that the loader has not found a needed library.
> Not sure where that library comes from, where it would be in the directory
> structure, etc.
>

According to https://developer.apple.com/forums/thread/655588
I think it comes from an SDK for your version of macOS. But I've never used
macOS so I don't know how it's supposed to work.

Please keep your replies on the mailing list, so people who actually
understand macOS can help. Replying just to me isn't going to get you
anywhere because I don't know where libSystem comes from any more than you
do.



>
> On Apr 24, 2022, at 11:19 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
> wrote:
>
>
>
> On Sun, 24 Apr 2022, 18:15 Jonathan Wakely, <jwakely.gcc@xxxxxxxxx> wrote:
>
>>
>>
>> On Sun, 24 Apr 2022, 17:59 C. David Whiteman via Gcc-help, <
>> gcc-help@xxxxxxxxxxx> wrote:
>>
>>> Am having some trouble compiling a simple fortran program on my M1
>>> MacBook Air. I am using the latest MacOS, Monterey 12.3.1, and the latest
>>> version of Xcode. I installed Homebrew and gcc to update my old version of
>>> gfortran. The fortran program on my desktop will compile when I use the
>>> command gfortran -c skippy.f, producing the executable file skippy.o
>>
>>
>> That's not an executable file, it's an object file. You used the -c
>> option which says to stop after compilation and not link the object into an
>> executable.
>>
>> If you remove the -c option you'll get an executable.
>>
>
> Oh but I see that when you tried that you got an error due to -lSystem
> being absent.
>
> That's not a gfortran library, so it looks like you need to install some
> additional packages on your Mac. Maybe the xcode command line tools or
> something.
>
>
>
>>
>>
>>
>> on my desktop. But I can’t get the executable file to run. I am an
>>> amateur and am really not that familiar with the unix commands, etc. Can
>>> someone give me some advice on this? Thanks.
>>>
>>> -Dave
>>>
>>> ~/Desktop 519 $ gfortran -o skippy.f
>>> gfortran: fatal error: no input files; unwilling to write output files
>>> compilation terminated.
>>> ~/Desktop 520 $ gfortran -c skippy.f
>>> ~/Desktop 521 $ ./skippy.o
>>> -bash: ./skippy.o: Permission denied
>>> ~/Desktop 522 $ gfortran skippy.f
>>> ld: library not found for -lSystem
>>> collect2: error: ld returned 1 exit status
>>> ~/Desktop 523 $ g77 skippy.f
>>> -bash: g77: command not found
>>> ~/Desktop 524 $
>>
>>
>




[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