叮叮当当:"没有可用的目标与这三重兼容
clang: 'No available targets are compatible with this triple
我从源代码构建了clang,并试图编译hello_world代码,但我得到了以下错误。
无法创建目标:'没有可用的目标与兼容这三个。
- clang 6.0.0版(trunk 315722)
- 目标:x86_64-unknown-linux-gnu
- 螺纹型号:posix
- InstalledDir:/opt/apps/crang/bin
代码如下:
#include <iostream>
int main()
{
int a = 1;
std::cout << a << std::endl;
return 0;
}
我试过了,clang++-std=c++11hello.cpp-o运行和clang++-std=c++11-target x86_64-unknown-linux-gnu hello.cpp-o运行
我刚开始使用emscripten,遇到了同样的问题。我在Linux(Ubuntu)上运行,确实是从git安装的。所以我尝试更新。
首先我尝试了这个命令:/emsdk update
,它吐出了这个消息:
You seem to have bootstrapped Emscripten SDK by cloning from GitHub. In
在这种情况下,使用";git pull";而不是";emsdk更新";更新emsdk。(如果您有本地更改,则不会自动执行此操作)或者,使用";emsdk更新标签";以刷新来自不同Git存储库的最新标签列表。
吐出的./emsdk update-tags
也是如此
Fetching all tags from Emscripten Github repository...
Done. 124 tagged releases available, latest is 1.37.37.
Fetching all tags from Binaryen Github repository...
Done. 51 tagged Binaryen releases available, latest is 1.37.37.
Fetching all precompiled tagged releases..
Downloading: /home/usr/program/emsdk/llvm-tags-32bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/linux_32bit/index.txt
Downloading: /home/usr/program/emsdk/llvm-tags-64bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/linux_64bit/index.txt, 1269 Bytes
然后我运行./emsdk install latest
,它吐出:
Installing SDK 'sdk-1.37.37-64bit'..
Installing tool 'clang-e1.37.37-64bit'..
The contents of file 'llvm/tag/linux_64bit/emscripten-llvm-e1.37.37.tar.gz' already exist in destination '/home/usr/program/emsdk/clang/e1.37.37_64bit', skipping.
Done installing tool 'clang-e1.37.37-64bit'.
Installing tool 'node-8.9.1-64bit'..
The contents of file 'node-v8.9.1-linux-x64.tar.xz' already exist in destination '/home/usr/program/emsdk/node/8.9.1_64bit', skipping.
Done installing tool 'node-8.9.1-64bit'.
Installing tool 'emscripten-1.37.37'..
The contents of file 'https://github.com/kripken/emscripten/archive/1.37.37.tar.gz' already exist in destination '/home/usr/program/emsdk/emscripten/1.37.37', skipping.
Done installing tool 'emscripten-1.37.37'.
Done installing SDK 'sdk-1.37.37-64bit'.
然后我运行命令./emsdk activate latest
,它吐出:
Writing .emscripten configuration file to user home directory /home/bandito/
The Emscripten configuration file /home/bandito/.emscripten has been rewritten with the following contents:
import os
LLVM_ROOT='/home/usr/program/emsdk/clang/e1.37.37_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/usr/program/emsdk/clang/e1.37.37_64bit/optimizer'
BINARYEN_ROOT='/home/usr/program/emsdk/clang/e1.37.37_64bit/binaryen'
NODE_JS='/home/usr/program/emsdk/node/8.9.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/home/usr/program/emsdk/emscripten/1.37.37'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
***To conveniently access the selected set of tools from the command line, consider adding the following directories to PATH, or call 'source ./emsdk_env.sh' to do this for you.*** /home/usr/program/emsdk:/home/usr/program/emsdk/clang/e1.37.37_64bit:/home/usr/program/emsdk/node/8.9.1_64bit/bin:/home/usr/program/emsdk/emscripten/1.37.37
Set the following tools as active:
clang-e1.37.37-64bit
node-8.9.1-64bit
emscripten-1.37.37
正如你所看到的,它在粗体/斜体文本中说要更新你的路径,所以我用source ./emsdk_env.sh
这样做了,它吐出:
Adding directories to PATH:
PATH += /home/usr/program/emsdk
PATH += /home/usr/program/emsdk/clang/e1.37.37_64bit
PATH += /home/usr/program/emsdk/node/8.9.1_64bit/bin
PATH += /home/usr/program/emsdk/emscripten/1.37.37
Setting environment variables:
EMSDK = /home/usr/program/emsdk
EM_CONFIG = /home/bandito/.emscripten
BINARYEN_ROOT = /home/usr/program/emsdk/clang/e1.37.37_64bit/binaryen
EMSCRIPTEN = /home/usr/program/emsdk/emscripten/1.37.37
我的程序现在运行良好。
这也修复了这个错误:
WARNING root: LLVM version appears incorrect (seeing "", expected "3.4")
emcc
版本从1.22更新为1.37.37
emcc(类似Emscripten gcc/clang的替换+模拟GNU ld的链接器)1.37.37clang 5.0.0版(emscripten 1.37.37:1.37.37)
相关文章:
- 毕达哥拉斯三重嵌套循环误解
- 遍历 std::set 中包含的所有三重不同值?
- 如何动态分配由三重指针到类的矩阵?
- 如何在C++中进行耗时的三重组合
- 删除BST节点:三重故障
- 启用中断时QEMU三重故障
- 如何修复我的 c++ 毕达哥拉斯三重查找器中的'access violation reading location'错误?
- 三重限制的正整数组合的非递归枚举
- 如何在三重运算符的帮助下通过最大值完成地图
- 三重继承,没有唯一的最终覆盖者
- C 避免使用三重指针
- 叮叮当当:"没有可用的目标与这三重兼容
- 复制一个三重嵌套容器
- 在 C 编程中可以有三重减号吗?什么意思
- 几何库中算法和数据的分离(需要三重调度?)
- 为什么我的三重对象被破坏了
- 三重与号"&&&"在C++中代表什么?
- 三重 AND("&& &")如何工作?
- 三重地图,包括2个关键点
- 解引用双指针、三重指针等等