首页 > 解决方案 > 在 Mac 上使用 Visual Studio Code 编译的 Fortran 导致“找不到 -lSystem 的库”

问题描述

我试图通过 Visual Studio 在 Fortran 中编译我的代码。我编写了一个简单的示例。

program fortran
    implicit none
    character*20 :: name
    print*,"what is your name"
    read *, name
    print *,"Hello ", name
end program fortran

但它无法在我的 Mac 终端上执行。错误信息是:'

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status

我还注意到,在 VS 的右下角,它显示the active environment is not selected. 我想也许它与这个问题有关?另外,我还下载了 intelapi 工具包。

那我现在该怎么办?

标签: macosvisual-studio-codefortranlinker-errors

解决方案


推荐阅读