首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >执行步骤"make“时Qt编译错误,-fno-堆栈限制

执行步骤"make“时Qt编译错误,-fno-堆栈限制
EN

Stack Overflow用户
提问于 2019-12-07 21:34:18
回答 1查看 336关注 0票数 2

在编译项目时遇到了一些问题,项目是由学校提供的,即使我不更改任何内容,在Qt中编译时也会出现以下错误:

代码语言:javascript
复制
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上运行

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-09 20:22:13

clang编译器不支持‘-fno-堆栈限制’。但是,通过将--stack标志传递给GNU链接器,可以获得相同的效果:

代码语言:javascript
复制
   --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

代码语言:javascript
复制
-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。例如,

代码语言:javascript
复制
clang++ -Wl,-stack_size -Wl,0x1000000 -o test test.cpp

其中0x1000000 =堆栈大小为16 of。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59230441

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档