gpt4 book ai didi

C++ Builder nullptr 关键字 "Undefined"

转载 作者:行者123 更新时间:2023-11-27 23:46:51 25 4
gpt4 key购买 nike

在 C++ Builder(柏林)中,编辑器的语法突出显示将 nullptr 显示为保留字。但是在编译时出现错误:

Undefined symbol 'nullptr'

nullptr 已添加到 C++11 标准中,据我所知,C++ Builder Berlin 支持 C++11。我一直在浏览 C++ 编译器选项,但找不到与选择要使用的 C++ 标准相关的任何信息。

C++ Builder Berlin 是否不支持 nullptr 并且荧光笔只是有问题?或者我可以在某处打开 C++11 支持吗?

最佳答案

as far I know, C++ Builder Berlin supports C++11.

更准确地说,只有它的Clang-based compilers支持 C++11。 "classic" Windows 32-bit compiler没有。

为 Windows 32 位编译时,您可以在项目选项中指定是使用 Classic 还是 Clang 编译器。根据 Embarcadero 的文档:

How to use the Clang-based compiler for Windows 32-bit projects :

BCC32C and BCC32X do not replace BCC32, RAD Studio gives you the option to choose the compiler for each of your projects. BCC32 is the default C++ compiler for 32-bit Windows.

To enable BCC32C or BCC32X for a specific project, select Project > Options > C++ Compiler and disable the Use 'classic' Borland compiler option under Classic Compiler.

The IDE will now use the Clang-enhanced Win32 compiler.

关于C++ Builder nullptr 关键字 "Undefined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49847129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com