如何为 C++11 配置 C++ 源代码生成
how to configure a c++ source build for c++11
我正在尝试从源代码制作和安装 MGSim 模拟器。为此,我输入了以下配置命令:
[root@dhcppc2 build-mtalpha]# ../configure --target=mtalpha --disable-trace-checks --prefix=/home/mehdi/mgsim CXX=g++ CPPFLAGS=-std=c++0x
我想我已经通过提供"c++0x"标志启用了 C++11 支持,但我仍然收到以下错误:
configure: error: *** A compiler with support for C++11 language features is required.
我输入了 c++0x 的其他替代方案,例如 c++11、g++、gnu-0x 等,但没有一个有效。
完整的配置输出在这里:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... mtalpha-unknown-none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for ranlib... ranlib
checking for a sed that does not truncate output... /usr/bin/sed
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for help2man... no
checking for rst2man... no
checking for rst2man.py... no
checking for tbl... tbl
checking for groff... groff
checking for ps2pdf... ps2pdf
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether the compiler supports GCC C++ ABI name demangling... yes
checking whether g++ -std=gnu++11 supports range-based for loops... yes
checking whether g++ -std=gnu++11 supports auto and decltype declarations... yes
checking whether g++ -std=gnu++11 supports double right angle brackets in template uses (a<b<int>>)... yes
checking whether g++ -std=gnu++11 supports initializer lists... yes
checking whether g++ -std=gnu++11 supports static_assert... yes
checking whether g++ -std=gnu++11 supports constructor reuse... yes
checking whether g++ -std=gnu++11 supports move references... yes
checking whether g++ -std=gnu++11 supports std::array... yes
checking whether g++ -std=gnu++11 supports threads... no
checking whether g++ -std=gnu++0x supports range-based for loops... yes
checking whether g++ -std=gnu++0x supports auto and decltype declarations... yes
checking whether g++ -std=gnu++0x supports double right angle brackets in template uses (a<b<int>>)... yes
checking whether g++ -std=gnu++0x supports initializer lists... yes
checking whether g++ -std=gnu++0x supports static_assert... yes
checking whether g++ -std=gnu++0x supports constructor reuse... yes
checking whether g++ -std=gnu++0x supports move references... yes
checking whether g++ -std=gnu++0x supports std::array... yes
checking whether g++ -std=gnu++0x supports threads... no
checking whether g++ -std=c++11 supports range-based for loops... yes
checking whether g++ -std=c++11 supports auto and decltype declarations... yes
checking whether g++ -std=c++11 supports double right angle brackets in template uses (a<b<int>>)... yes
checking whether g++ -std=c++11 supports initializer lists... yes
checking whether g++ -std=c++11 supports static_assert... yes
checking whether g++ -std=c++11 supports constructor reuse... yes
checking whether g++ -std=c++11 supports move references... yes
checking whether g++ -std=c++11 supports std::array... yes
checking whether g++ -std=c++11 supports threads... no
checking whether g++ -std=c++0x supports range-based for loops... yes
checking whether g++ -std=c++0x supports auto and decltype declarations... yes
checking whether g++ -std=c++0x supports double right angle brackets in template uses (a<b<int>>)... yes
checking whether g++ -std=c++0x supports initializer lists... yes
checking whether g++ -std=c++0x supports static_assert... yes
checking whether g++ -std=c++0x supports constructor reuse... yes
checking whether g++ -std=c++0x supports move references... yes
checking whether g++ -std=c++0x supports std::array... yes
checking whether g++ -std=c++0x supports threads... no
configure: error: *** A compiler with support for C++11 language features is required.
完整的配置日志可在此处找到。
配置脚本提到错误之前该行缺少线程支持。 我怀疑这是巧合。
快速谷歌找到一个SO帖子,说这就是您启用线程支持的方式:-pthread
.
相关文章:
- LLVM |如何实现逻辑非操作的 IR 代码生成
- C++基于输入参数的动态代码生成
- C++使用代码生成错误
- C++代码生成核心文件,就像 gdb >> gcore 一样
- 卤化物:X86汇编代码生成
- 如何将 MATLAB 图像处理库内置函数转换为 MATLAB 编码器代码生成不支持的 C++?
- 为什么我的代码为同一代码生成不同的值
- 我应该担心动态代码生成与用C++编写的其他模块不匹配吗?
- 企业架构师 - 单独的代码生成标头和实现
- C++ 代码生成和模板专用化
- IBM Rhapsody c++ 代码生成 - 为什么总是在状态图周围放置一个活动状态
- 如何从 c++ 代码生成 arm64-v8a 64 位共享对象?
- 在语法文件上运行C 的ANTL4解析器显示错误33:缺少代码生成模板非局部trrefheader
- 使用LLVM在代码生成期间,更喜欢LLVM :: StringMap或STD :: MAP
- 如何根据模板参数制作代码生成
- 如何在C++中使用以下代码生成秒表/倒计时
- 为什么 C++ 和 Python 中的相同代码生成不同的输出?
- 获取 llvm::MCJIT 代码生成后的函数大小
- JIT代码生成后,如何检索LLVM ::指令地址
- clang和gcc为相同的代码生成不同的逻辑.哪个是正确的