xmake总是报告:错误:无法获取cxx的程序,为什么
xmake always reports: error: cannot get program for cxx, why?
我在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=叮当LD=叮当++xmake
现在可以工作了,请更新到最新版本。
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++,系统无法执行指定的程序
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 重载操作程序时出错>>用于类中的字符串 memebr
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 试图在visual studio上用C++创建一个桌面应用程序
- 模板元程序查找相似的连续类型名称
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 如何通过cpp程序运行shell脚本
- 有没有什么方法可以使用一个函数中定义的常量变量,也可以由c++中同一程序中的其他函数使用
- IPC使用多个管道和分支进程来运行Python程序
- 如何将c++程序的一些输出传递给shell,以便在shell中使用
- 使用C++程序合并排序没有得到正确的输出
- xmake总是报告:错误:无法获取cxx的程序,为什么
- 使用CMake ExternalProject_Add构建mongo cxx驱动程序
- C++编译器 g++.exe 无法编译简单的测试程序 - 确定 CXX 编译器是否工作失败
- Mongodb Cxx 驱动程序测试在发布版本中崩溃 [ 在调试中工作正常]
- CMake:C编译器无法编译一个简单的测试程序.令人惊讶的是,C编译器的标识是未知的,但CXX是GNU4.9.2