我在我的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发布于 2018-11-06 07:49:47
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
发布于 2021-04-23 11:33:37
现在可以使用了,请更新到最新版本。
https://stackoverflow.com/questions/53112099
复制相似问题