2011-10-19 53 views
7

我希望我的應用程序能夠使用2GB以上的內存,我搜索了一下,發現IMAGE_FILE_LARGE_ADDRESS_AWARE命令可以讓我做到這一點。Delphi 2007 IMAGE_FILE_LARGE_ADDRESS_AWARE

所以我添加

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} 

要我的程序的.dpr文件,所有的用途和後{$ R * .RES}行,

但是當我編譯,我得到的錯誤:

E2003 Undeclared identifier: 'IMAGE_FILE_LARGE_ADDRESS_AWARE' 

我在做什麼錯?

此外,在64位Windows 7,我需要有引導設置惹周圍此命令的工作,或者只是編譯命令32位應用程序,它會自動別的做的一切?

感謝

+10

添加'使用Windows' –

+2

謝謝,這工作! – KingOfKong

回答

5

Also, on Windows 7 64bit, do I need to mess around with boot settings for this command to work, or just compile a 32bit application with the command and it will do everything else automatically?

64位Windows會自動提供4 GB的地址空間,而無需啓動調整。

http://msdn.microsoft.com/en-us/library/windows/desktop/bb613473%28v=vs.85%29.aspx

To enable an application to use the larger address space, set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header. The linker included with Microsoft Visual C++ supports the /LARGEADDRESSAWARE switch to set this flag. Setting this flag and then running the application on a system that does not have 4GT support should not affect the application.

On 64-bit editions of Windows, 32-bit applications marked with the IMAGE_FILE_LARGE_ADDRESS_AWARE flag have 4 GB of address space available.

5

答案的實際問題是添加到使用單位Windows

相關問題