2011-10-19 18 views
7

Quiero que mi aplicación pueda usar más de 2 GB de memoria, busqué en Google y descubrí que el comando IMAGE_FILE_LARGE_ADDRESS_AWARE me permite hacerlo.Delphi 2007 IMAGE_FILE_LARGE_ADDRESS_AWARE

por lo que añade

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} 

Para .dpr archivo de mi programa, después de todos los usos y el {$ R * .res} línea,

pero cuando compilo, me sale el error:

E2003 Undeclared identifier: 'IMAGE_FILE_LARGE_ADDRESS_AWARE' 

¿Qué estoy haciendo mal?

Además, en Windows 7 64bit, ¿necesito perder el tiempo con las configuraciones de arranque para que funcione este comando, o simplemente compilar una aplicación de 32 bits con el comando y hará todo lo demás automáticamente?

Gracias

+10

agregar 'usa Windows' –

+2

¡Gracias, eso funcionó! – KingOfKong

Respuesta

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 de Windows proporcionará espacio de direcciones 4 GB de forma automática, sin ajustes de arranque.

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

La respuesta a la pregunta real es agregar utiliza la unidad Windows.

Cuestiones relacionadas