$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE lazarus / 62-General ---------------------------------------------------------------------- 440bx · 2021-11-21 01:28 Hello, I figured I'd try the "$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE" in a program but the compiler isn't liking it. With FPC v3.0.4, I get the error: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Error: Identifier not found "IMAGE_FILE_LARGE_ADDRESS_AWARE" With FPC v3.2.2, I get the error: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Error: Compile time expression: Wanted Integer but got AnsiString at SETPEFLAGS What's the magic incantation to make that option work ? Thank you for your help. ---------------------------------------------------------------------- loaded · 2021-11-21 06:33 Hi This is how I work. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$SetPeFlags $0020}By the way, I want to talk about an interesting situation. It works when Code is first added to the unit. Then if the unit is recompiled without any changes, it doesn't work. ---------------------------------------------------------------------- Josh · 2021-11-21 06:41 the constant IMAGE_FILE_LARGE_ADDRESS_AWARE is defined in defines.inc, which is part of the windows unit. so add the windows unit to your uses clause, then set the flag after the uses , should work fine. uses windows, ........ {$SetPeFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} ---------------------------------------------------------------------- 440bx · 2021-11-21 07:15 Thank you loaded and Josh. I didn't think about the fact that the directive must appear _after_ the Windows unit.  Thank both again, that was very helpful. ---------------------------------------------------------------------- PascalDragon · 2021-11-21 12:32 Quote from: 440bx on November 21, 2021, 08:15:55 amI didn't think about the fact that the directive must appear _after_ the Windows unit.  I should have mentioned that in the other thread, but the directives $SetPEFlags and $SetPEOptFlags either take an integer value, an integer constant identifier (3.0.x) or an integer constant expression (which in turn can contain constant values or identifiers) (3.2+). And the identifiers need to be in scope of course.