(unrecognized flag '-Zc:nrvo' in 'p2')怎么禁用?
时间: 2023-12-25 10:04:16 浏览: 478
如果你想禁用"-Zc:nrvo"这个编译选项,你可以使用以下方法:
1. 如果你使用的是 Visual Studio,可以在项目属性的“C/C++” -> “命令行”选项卡中找到该选项并将其删除。
2. 如果你使用的是 GCC 或 Clang,可以在命令行中使用"-fno-elide-constructors"选项来禁用 NRVO。
例如,你可以将编译命令从:
```
g++ -Zc:nrvo -o myprogram myprogram.cpp
```
改为:
```
g++ -fno-elide-constructors -o myprogram myprogram.cpp
```
这样就可以禁用 NRVO 优化了。
相关问题
在make prepare时报错aarch64-none-linux-gnu-gcc: error: unrecognized argument in option '-mcmodel=kernel' aarch64-none-linux-gnu-gcc: note: valid arguments to '-mcmodel=' are: large small tiny aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-mno-sse'; did you mean '-fno-dse'? aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-mno-mmx' aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-mno-sse2' aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-mno-3dnow' aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-m64' aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-mno-red-zone' scripts/Makefile.build:273: recipe for target 'scripts/mod/empty.o' failed具体如何解决
这个错误可能是由于编译器版本不兼容或编译选项有误导致的。您可以尝试以下步骤来解决该问题:
1. 确认您使用的是正确版本的编译器。您可以尝试更新编译器或使用另一个版本的编译器。
2. 检查编译选项。在Makefile中,可能有一些选项需要根据您的编译器版本进行调整。 您可以尝试删除一些选项,或者添加一些适当的选项,例如:
-mcmodel=large
-mno-sse -fno-dse
-mno-mmx
-mno-sse2
-mno-3dnow
-mno-red-zone
3. 检查您的内核配置。您可以尝试禁用CONFIG_STRICT_KERNEL_RWX选项,并重新编译内核。
希望这些解决方案可以帮助您解决问题。
arm-xilinx-linux-gnueabi-gcc: error: unrecognized command line option ‘-mrecord-mcount’; did you mean ‘-frecord-marker=4’?
This error message indicates that the compiler you are using (arm-xilinx-linux-gnueabi-gcc) does not recognize the command line option "-mrecord-mcount". It suggests that you may have meant to use "-frecord-marker=4" instead.
The "-mrecord-mcount" option is used to generate code that records function call counts, which can be used for profiling and optimization. However, this option may not be supported by all compilers or platforms.
If you need to use function call counting in your code, you may want to investigate alternative approaches that are supported by your compiler and platform. If you are not using function call counting, you can simply remove the "-mrecord-mcount" option from your build command.
阅读全文