【问题标题】:OS X Yosemite gcc unrecognized command line option 'mdll' after brew install gccbrew install gcc 后 OS X Yosemite gcc 无法识别命令行选项“mdll”
【发布时间】:2015-05-22 05:39:49
【问题描述】:

我使用 brew 安装了 gcc,因为我需要安装 brew 的 Fortran 包。 brew install gcc安装的gcc包好像不支持mdll标志。如何安装正确版本的 Fortran 和 gcc?

$ which gcc
/usr/local/bin/gcc

$ gcc --version
gcc (GCC) 4.9.2 20141029 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -mdll
gcc: error: unrecognized command line option ‘-mdll’
gcc: fatal error: no input files
compilation terminated.

【问题讨论】:

标签: c++ macos gcc homebrew osx-yosemite


【解决方案1】:

根据gcc(1) 手册页:

-mdll
  This option is available for Cygwin and MinGW targets. It
  specifies that a DLL---a dynamic link library---is to be generated,
  enabling the selection of the required runtime startup object and
  entry point.

由于 OS X 不是 Cygwin 或 MinGW,因此可以肯定地假设没有任何版本的 GCC 将在 OS X 上启用它。

如果您尝试构建动态链接对象(UNIX 术语中的“共享对象”),请查看-dynamic/-dynamiclib 标志。它们似乎是 OS X 上的大致等价物。

【讨论】:

    猜你喜欢
    • 2020-10-06
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    • 2021-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-26
    相关资源
    最近更新 更多