gpt4 book ai didi

c++ - 执行步骤 “make”和-fno-stack-limit时,Qt Creator编译错误

转载 作者:行者123 更新时间:2023-12-02 10:23:03 24 4
gpt4 key购买 nike

在编译项目时遇到一些问题,该项目是由学校提供的,即使我不做任何更改,在Qt Creator中进行编译时也会遇到这些错误:

clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
make: clang: error: unknown argument: '-fno-stack-limit'
*** [adapter.o] Error 1
make: *** Waiting for unfinished jobs....
clang: error: unknown argument: '-fno-stack-limit'
make: *** [trailblazer.o] Error 1
make: *** [types.o] Error 1
make: *** [trailblazergui.o] Error 1
make: *** [BasicGraph.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
make: *** [console.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
make: *** [costs.o] Error 1
make: *** [direction.o] Error 1
22:27:18: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Trailblazer (kit: Desktop Qt 5.13.0 clang 64bit)
When executing step "Make"

有什么想法可能有问题吗?
在Mac OS上运行

最佳答案

clang编译器不支持'-fno-stack-limit'。但是您可以通过将--stack标志传递给GNU链接器来获得相同的效果:

   --stack reserve
--stack reserve,commit
Specify the number of bytes of memory to reserve (and optionally commit) to be used as stack for this program. The default is 2MB
reserved, 4K committed. [This option is specific to the i386 PE targeted port of the linker]

对于Mac OS的默认链接器,您可以传递 -stack_size:
-stack_size size
Specifies the maximum stack size for the main thread in a program. Without this
option a program has a 8MB stack. The argument size is a hexadecimal number with
an optional leading 0x. The size should be an even multiple of 4KB, that is the
last three hexadecimal digits should be zero.

要将标志传递给链接器,可以使用 -Wl。例如。,
clang++ -Wl,-stack_size -Wl,0x1000000 -o test test.cpp

其中0x1000000 =堆栈大小16MB。

关于c++ - 执行步骤 “make”和-fno-stack-limit时,Qt Creator编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59230441/

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