New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#Include <Foo> includes twice #4
Comments
I think your original approach is better because the library file is inserted at the same position the interpreter reads it, and there might be scripts that rely on this behaviour, especially class libraries ("Why doesn't my script work when it's compiled?"). Anyway, I think that it would be an even better idea to change AutoHotkey to not write the |
Ah, yes. Now that you mention it, I think that's why I did it that way. Letting /iLib handle it would probably also cause |
The following includes Foo.ahk twice, when compiled:
The original Ahk2Exe writes the processed script text into a temporary file as it goes along, and passes this file to AutoHotkey.exe /iLib. Because the #Include line was stripped out before it got to AutoHotkey.exe, it didn't add the lib file to its output. I implemented
#Include <Lib>
support in Ahk2Exe to resolve this, though I realize now that I could have simply written the original #Include line into the temporary file and let AutoHotkey.exe do the rest.Since your script passes the original filename to AutoHotkey.exe /iLib, both it and your script process the #Include line. This causes the file to be included twice. I think the best solution is to simply ignore any instances of
#Include <Lib>
and let AutoHotkey.exe handle it. You can either pass the original filename as you do now, or pass a temporary file containing the processed text.The text was updated successfully, but these errors were encountered: