作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的 Mac 上“brew install xmake”,有一个 .cpp 文件,我运行 xmake 并在目录中生成一个 xmake.lua。然后报告:
error: cannot get program for cxx
我已经安装了 clang(别名为 g++)。它工作正常。然后我:
$sudo ln -s /usr/bin/g++ /usr/local/bin/cxx
好了,再次运行xmake,还是报同样的错误:
error: cannot get program for cxx
如何处理?谢谢
--------------------我试过这些,不工作:
$xmake f -p cross
$xmake
error: cannot get program for cxx
$export CC=clang LD=clang++ xmake
$xmake
error: cannot get program for cxx
--------------------查看我的诊断:
$xmake f -p cross -c
(In fact no output)
$xmake -r -v
configure
{
plat = cross
, arch = none
, ccache = true
, kind = static
, buildir = build
, host = macosx
, mode = release
, clean = true
}
checking for the g++ ... no
checking for the linker (ld: g++) ... no
checking for the gcc ... no
checking for the linker (ld: gcc) ... no
checking for the clang++ ... no
checking for the linker (ld: clang++) ... no
checking for the clang ... no
checking for the linker (ld: clang) ... no
error: cannot get program for ld
$which g++
/usr/bin/g++
$which clang
/usr/bin/clang
最佳答案
xmake 将在 macOS 上检测并使用 xcrun -sdk macosx clang
。您是否安装了 Xcode 命令行工具?
如果没有,可以切换到跨平台编译。例如
xmake f -p cross
xmake
它将直接使用 gcc/clang。
或设置--cc=clang
或CC、LD环境变量来修改编译器和链接器。
xmake f -c --cc=clang --ld=clang++
xmake
或者
导出 CC=clang LD=clang++xmake
关于lua - xmake总是报: error: cannot get program for cxx, 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53112099/
我是一名优秀的程序员,十分优秀!