2011-10-19 19 views
7

Uygulamamın 2 GB'den fazla bellek kullanabilmesini istiyorum, etrafta dolaştım ve IMAGE_FILE_LARGE_ADDRESS_AWARE komutunun bunu yapmamı sağladığını gördüm.Delphi 2007 IMAGE_FILE_LARGE_ADDRESS_AWARE

yüzden {* $ R res} tüm kullanımlar ve sonra benim programın .dpr dosyası için satır,

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} 

eklendi ama derleme yaparken, ben hatayı alıyorum:

E2003 Undeclared identifier: 'IMAGE_FILE_LARGE_ADDRESS_AWARE' 

Neyi yanlış yapıyorum?

Ayrıca, Windows 7 64bit'de, bu komutun çalışması için önyükleme ayarlarıyla uğraşmam gerekiyor mu, yoksa yalnızca 32 bitlik bir uygulamayı komutla derlemem gerekiyor ve her şey otomatik olarak yapılıyor mu?

Teşekkür

+10

add 'Windows'un kullandığı –

+2

Teşekkürler, işe yaradı! – KingOfKong

cevap

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-bit Windows önyükleme tweaks olmadan, otomatik olarak 4 GB adres alanı sağlayacaktır.

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

: gerçek sorunun cevabı için eklemektir

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.