相关疑难解决方法(0)

xcode已安装但找不到macOS_SDK_headers_for_macOS_10.14.pkg

我在编译 gcc 时遇到问题,可以追溯到 Catalina 存在 xcode 问题,因此我在 OS X mojave 上安装 Haskell 时参考了此处的链接“macOS_SDK_headers_for_macOS_10.14.pkg 与此版本的 macOS 不兼容”并尝试解决问题。但是,虽然我重新安装了xcode,但我无法打开macOS_SDK_headers_for_macOS_10.14.pkg,因为该文件不在/Library/Developer/CommandLineTools/Packages/中。我的文件看起来像;

MacBook-Pro:CommandLineTools myname$ ls
Library SDKs    usr
Run Code Online (Sandbox Code Playgroud)

我在哪里可以找到该文件?我应该手动将 pkg 添加到文件夹中吗?

xcode gcc gcc-warning

5
推荐指数
1
解决办法
1039
查看次数

_ctermid.h:在没有 Xcode 的情况下,mac 上没有此类文件或目录错误

我试图使用 gcc 10.2.8 编译我的代码,但出现此错误:

scons: *** [S.os] Error 1
In file included from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cstdio:42,
                 from Public_Library/C.h:10,
                 from Public_Library/D.h:11,
                 from Public_Library/RS.h:10,
                 from Projects/S/main.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我发现了一些这样的问题,但问题是我的 Mac 上没有 Xcode,而且我已经多次更新了我的命令行工具,但它没有用。顺便说一下,我使用的是 OSX 10.14.6。

c++ macos gcc

5
推荐指数
1
解决办法
195
查看次数

安装phpredis MAC OSX

谁能帮助我在MAC OSX中安装php-redis。

brew install php-redis
Run Code Online (Sandbox Code Playgroud)

不工作。

pecl install php-redis
Run Code Online (Sandbox Code Playgroud)

也无法正常工作-

无效的软件包名称/软件包文件“ php-redis”。

自制错误:

homebrew_error

php macos redis php-7.2

4
推荐指数
3
解决办法
7049
查看次数

在 macOS Mojave 10.14.6 上找不到 _ctermid.h

macOS Mojave 10.14.6 (18G7016) 上,gcc无法_ctermid.h再找到该文件

In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/string:40,
                 from /Users/Projects/test.h:10,
                 from /Users/Projects/test.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory
  219 | #include <_ctermid.h>
Run Code Online (Sandbox Code Playgroud)

这可能是由 macOS 软件更新或brew upgrade.

这可能与一个较旧的问题Can'tcompileCprogramonaMacafterupgradetoMojave相关。

我尝试了建议的解决方案:

  • 删除整个CommandLineTools文件夹(sudo) rm -rf /Library/Developer/CommandLineTools并重新安装xcode-select --install
  • 安装macOS_SDK_headers_for_macOS_10.14open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
  • 重新安装brewgcc(也gcc@9gcc@8

他们都没有工作。

macos homebrew gcc

4
推荐指数
1
解决办法
564
查看次数

macOS Mojave上的gcc损坏

看来我的gcc坏了。

当我尝试从PyPI安装软件包时,出现以下错误:

    ./uwsgi.h:165:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
In file included from core/protocol.c:1:
./uwsgi.h:165:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
Run Code Online (Sandbox Code Playgroud)

XCode命令行工具已安装:

    ?  xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Run Code Online (Sandbox Code Playgroud)

并从brew安装gcc:

?  brew install gcc
Warning: gcc 8.2.0 is already installed and up-to-date
To reinstall 8.2.0, run `brew reinstall gcc`
Run Code Online (Sandbox Code Playgroud)

当我尝试识别使用哪个gcc时/usr/bin/gcc。我认为这是XCode版本。

但是brew中没有gcc二进制文件:

?  ls /usr/local/bin/gcc-*
/usr/local/bin/gcc-8        /usr/local/bin/gcc-ar-8 …
Run Code Online (Sandbox Code Playgroud)

macos gcc

3
推荐指数
1
解决办法
2642
查看次数

无法使用 c++11 编译简单的 Rcpp 函数

问题背景

升级到后,我似乎无法编译一个使用// [[Rcpp::plugins(cpp11)]]. 我试过了:

  • Makevars根据这个答案进行编辑
  • 升级后运行xcode-select --install以下有关在下编译 C 的链接讨论
  • 更改 include, string/string.h会导致相同的错误

代码

我起草的函数是为了生成错误:

#include <Rcpp.h>
#include <string.h> // std::string, std::stod
using namespace Rcpp;

// [[Rcpp::plugins(cpp11)]]

// [[Rcpp::export]]
NumericVector convertToDouble(Rcpp::StringVector x) {
    // Numeirc vector to store results
    NumericVector res;
    // Double for converted values
    double converted_double;
    for(Rcpp::StringVector::iterator it = x.begin(); it != x.end(); ++it) {
        // Get [] for vector element
        int index …
Run Code Online (Sandbox Code Playgroud)

c++ r rcpp c++11 macos-mojave

2
推荐指数
1
解决办法
721
查看次数

标签 统计

gcc ×4

macos ×4

c++ ×2

c++11 ×1

gcc-warning ×1

homebrew ×1

macos-mojave ×1

php ×1

php-7.2 ×1

r ×1

rcpp ×1

redis ×1

xcode ×1