在编译项目时遇到了一些问题,项目是由学校提供的,即使我不更改任何内容,在Qt中编译时也会出现以下错误:
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上运行
发布于 2019-12-09 20:22:13
clang编译器不支持‘-fno-堆栈限制’。但是,通过将--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 =堆栈大小为16 of。
https://stackoverflow.com/questions/59230441
复制相似问题