- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我从源代码构建 clang,并尝试编译 hello_world 代码,但出现以下错误。
unable to create target: 'No available targets are compatible with this triple.
代码如下:
#include <iostream>
int main()
{
int a = 1;
std::cout << a << std::endl;
return 0;
}
我试过了,clang++ -std=c++11 hello.cpp -o run和 clang++ -std=c++11 -target x86_64-unknown-linux-gnu hello.cpp -o run
最佳答案
我刚开始使用 emscripten,遇到了同样的问题。我在 Linux (Ubuntu) 上运行并从 git 安装。所以我尝试更新。
首先我尝试了这个命令:/emsdk update
输出了这条消息:
You seem to have bootstrapped Emscripten SDK by cloning from GitHub. In
在这种情况下,使用“git pull”而不是“emsdk update”来更新emsdk。 (如果您有本地更改,则不会自动执行此操作)或者,使用“emsdk update-tags”刷新来自不同 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-like replacement + linker emulating GNU ld) 1.37.37clang version 5.0.0 (emscripten 1.37.37 : 1.37.37)
关于c++ - clang : 'No available targets are compatible with this triple,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46778183/
我知道的引用资料在这里: http://clang.llvm.org/docs/ClangCommandLineReference.html http://clang.llvm.org/docs/Di
这两个工具似乎有一些共同的目标,而 documentation of clang-tidy对其功能非常明确,clang-check's有点稀疏。 如果我只能运行这些工具中的一个,同时进行相同的检查,那
我不清楚 clang 使用的汇编器。 AFAIK native 又名 GNU 汇编器和链接器被使用(与 gcc 一起提供)。 clang -v main.c clang version 3.4.2 T
在哪里可以找到 Clang 标志的完整列表? 还有一些,例如 -include-pch,甚至没有在手册页中列出。 :( 我知道 GCC 使用一些相同的标志,但它不包含诸如 -Os 之类的文档,我相信这
大多数成熟的编译器似乎对堆栈变量破坏有很好的支持。 海湾合作委员会:-fstack-protector xlC: -qstackprotect 英特尔:-fstackprotector window
我的命令: /usr/bin/c++ -fPIC -I/Users/me/project/include -I/usr/local/include/opencv \ -I/usr/local/incl
我正在研究 CLang 3.5。我正在尝试获取有关在 C++ 项目中声明的变量的信息。 如何获取 clang::VarDecl 中变量的数据类型或限定类名, clang::FieldDecl或 cla
我正在尝试构建 LLVM 编译器,以便我可以在 Apple M1 上启用 OpenMP。 我正在使用 LLVM 开发树,(因为我最近看到一些 OpenMP 运行时对此进行了处理)。 我已经结束了这个脚
背景: 在 Windows 10 PC 上,我有一个 C++ 代码库。使用 CMAKE 我生成了一个 Mingw-w64 项目(使用 Eclipse IDE)和一个 Visual Studio 201
下面是我想做的。 我想通过使用 cmake 的正确程序检测 clang 来使用 clang/clang++ 进行编译。 请告诉我可以解决我将描述的问题的正确程序。 test environment:
基本问题 我有以下代码 #include #include using namespace std; int main () { int32_t spam; spam=5; cout
当我在xcode中编译.c文件时,出现错误提示: clang error: argument unused during compilation: '-fno-objc-exceptions' [-W
Clang has several kinds of diagnostics ,其中三种主要是错误、警告和注释。 注释通常伴随着某些警告和错误,例如重复定义: error: conflicting t
我正在调整 Clang 工具模板(如 here 所述)以在我的代码中搜索特定的方法调用。为了稍后重写该调用,我想获取调用该方法的参数的类型,以及调用该方法的对象的类型。 我设法找到了一个可以回调以下内
我必须通过在它之前添加一个语句来检测 clang 中的某些语句。我有一个指向 Expr 对象的指针,我需要在包含它的语句之前插入另一个语句。现在我正在使用一种hacky方法,它只是将 SourceLo
类 clang::ASTContext 有一个方法: DynTypedNodeList getParents(const NodeT &Node) 它返回给定 AST 节点的父节点列表。 通常 AST
我想修改代码分析器程序clang-tidy的检查正在做,但是好像是配置文件.clang-tidy的内容正在被忽视。 我通过调用 clang-tidy 创建文件带旗-dump-config并将输出重定向
有没有办法用clang创建一个可以合理地适合页面的调用图? 即给出: #include using namespace std; int main() { int a; cin>>a;
我正在编写一个 Clang 工具,并且试图弄清楚如何在访问程序 AST 的情况下评估字符串文字。给定以下程序: class DHolder { public: DHolder(std::strin
我想在 Clang 中尝试一些新功能,有人提到我 Clang TOT . 现在这可能是一个明显的问题,到底是什么Clang TOT . TOT 一定是一些我不熟悉的首字母缩写词。 任何人都可以启发我吗
我是一名优秀的程序员,十分优秀!