Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GCC赢得';我不能在macOS上编译任何东西_Macos_Gcc - Fatal编程技术网

GCC赢得';我不能在macOS上编译任何东西

GCC赢得';我不能在macOS上编译任何东西,macos,gcc,Macos,Gcc,最近(自从Catalina发布和xcode更新后,但我仍在运行Mojave),我发现通过macports安装的gcc已经损坏。我收到错误消息,说找不到系统包含: ld: library not found for -lSystem 我在这里尝试过解决方案:-但当我为macOS_10.14.pkg安装macOS_SDK_headers_时,它实际上并没有在/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De

最近(自从Catalina发布和xcode更新后,但我仍在运行Mojave),我发现通过macports安装的gcc已经损坏。我收到错误消息,说找不到系统包含:

ld: library not found for -lSystem
我在这里尝试过解决方案:-但当我为macOS_10.14.pkg安装macOS_SDK_headers_时,它实际上并没有在/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs中创建任何内容;我看到的只是10.15(Catalina)sdk

如果我只是将MacOSX10.14.sdk与MacOSX10.15.sdk进行sym链接(可能不是一个好主意),我会得到一组不同的错误:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
             from /opt/local/include/gcc8/c++/cwchar:44,
             from /opt/local/include/gcc8/c++/bits/postypes.h:40,
             from /opt/local/include/gcc8/c++/iosfwd:40,
             from /opt/local/include/gcc8/c++/ios:38,
             from /opt/local/include/gcc8/c++/ostream:38,
             from /opt/local/include/gcc8/c++/iostream:39,
             from /Users/pae9/soft/src/cmake/LIGO_support/restrictHealMap.cpp:4:
/opt/local/lib/gcc8/gcc/x86_64-apple-darwin18/8.3.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
 char *ctermid(char *);
换句话说,现在看来macports头与xcode头冲突

我以前从来没有遇到过问题;我认为这个问题可以追溯到上一次xcode更新(目前是11.2版(11B52))

任何想法或建议都非常受欢迎-我真的希望能够回到使用gcc编译代码上来


仅供参考,我正在使用gcc7(来自macports),以与我实际的实时系统linux服务器保持一致,但我尝试了gcc 8和gcc 9,并获得了相同的结果。

cd/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/


sudo ln-s MacOSX10.15.sdk MacOSX10.14.sdk

好的,如果我像上面那样做ln-s,并且移动#include作为我所有文件中的第一个include,问题就会消失

在我看来,这在Apple SDK标题中是一个严重的问题,因为像这样的冲突定义肯定不会发生