代码块 - 用大地址感知标志进行编译 [英] codeblocks - compile with large-adress-aware flag

查看:282
本文介绍了代码块 - 用大地址感知标志进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Codeblocks在<64位系统上使用 LARGE_ADRESS_AWARE 标志编译32位应用程序?我需要使用比2GB更多的内存。

解决方案

应该是添加 -Wl, -large-address-aware 到链接标志。我没有使用CodeBlocks,所以不能告诉你如何一步一步做到这一点,但我确定在项目设置中有一个链接选项组件,您可以将该字符串添加到该组件中。

链接器选项:
http://sourceware.org/binutils/docs-2.17/ld/Options.html



编辑:当然,如果你有一个足够现代化的gcc-mingw在你的系统上,你应该能够在编译和链接阶段给它-m64,并获得一个原生的64位应用程序,在这一点上,你可以使用尽可能多的内存,只要你喜欢(好吧,直到你耗尽交换空间或48位地址范围,以先到者为准 - 可能交换空间 - 除非你有超过256TB的磁盘空间......)

How can I compile a 32-bit app on a 64-bit system with the LARGE_ADRESS_AWARE flag using Codeblocks? I need to use more memory than 2GB.

解决方案

Should be a case of adding -Wl,--large-address-aware to the linking flags. I don't use CodeBlocks, so can't tell you how you do that step by step, but I'm sure there is a "Linking Options" component in your project settings that you can add this string into.

The Linker options: http://sourceware.org/binutils/docs-2.17/ld/Options.html

Edit: Of course, if you have a modern enough gcc-mingw on your system, you should be able to give it -m64 for the compile and link stages, and get a native 64-bit app, at which point you can use as much memory as you like (well, until you exhaust either swap space or 48 bits of address range, whichever comes first - probably swap space - unless you have more than 256TB of disk-space...)

这篇关于代码块 - 用大地址感知标志进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆