WebAssembly-cn / WebAssembly-cn/pit
Docker + ubuntu image 编译 emsdk 失败,提示 No CMAKE_CXX_COMPILER could be found
- Dominant language
- No language data
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
镜像 ubuntu:latest
环境准备, [参考](http://webassembly.org/getting-started/developers-guide/)
```shell
$ apt update
$ apt install git cmake gcc python
```
编译
```shell
$ git clone https://github.com/juj/emsdk.git
$ cd emsdk
$ ./emsdk install sdk-incoming-64bit binaryen-master-64bit
```
报错
```shell
CMake Error at CMakeLists.txt:47 (project): No CMAKE_CXX_COMPILER could be found. Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. -- Configuring incomplete, errors occurred! See also "/root/emsdk/clang/fastcomp/build_incoming_64/CMakeFiles/CMakeOutput.log". See also "/root/emsdk/clang/fastcomp/build_incoming_64/CMakeFiles/CMakeError.log". CMake invocation failed due to exception! Working directory: /root/emsdk/clang/fastcomp/build_incoming_64 Command '['cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DPYTHON_EXECUTABLE=/usr/bin/python', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '-DLLVM_ENABLE_ASSERTIONS=ON', '/root/emsdk/clang/fastcomp/src']' returned non-zero exit status 1 Installation failed!
```
解决
官方的[入门指南](http://webassembly.org/getting-started/developers-guide/)里只提到gcc,但实际也依赖 g++。一步到位可以安装 `build-essential`,想要精简可以只安装 `cmake` `gcc` 和 `g++`
所以,**安装 g++** 后重新编译
```shell
$ apt install g++
```
解决。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.