About compiling AHK with GCC, the only info I found is 11 years old post:
https://autohotkey.com/board/topic/28748-compiling-with-gcc/
So many things changed since then. Links r dead. I see absolutely different errors flying by. I managed to reduce compiler's (GCC 5.1.0-2 x64) errors down to 15 (I disabled zillion of warnings) but stuck atm. I'm well aware its only the first step of getting AHK compiled. To make .exe completely functional might require much longer time. Nonetheless the path might be not so hard - Id like to assess it at least.
errors
Is here anybody who tried to compile AHK L v2 with GCC recently?In file included from X:/GCC/x86_64-w64-mingw32/include/combaseapi.h:154:0,
from X:/GCC/x86_64-w64-mingw32/include/objbase.h:14,
from X:/GCC/x86_64-w64-mingw32/include/ole2.h:17,
from X:/GCC/x86_64-w64-mingw32/include/wtypesbase.h:12,
from X:/GCC/x86_64-w64-mingw32/include/shlobj.h:9,
from r:\ahk\source\stdafx.h:61,
from r:\ahk\source\AutoHotkey.cpp:17:
X:/GCC/x86_64-w64-mingw32/include/unknwnbase.h: In member function 'HRESULT IUnknown::QueryInterface(Q**)':
X:/GCC/x86_64-w64-mingw32/include/unknwnbase.h:74:39: error: expected primary-expression before ')' token
return QueryInterface(__uuidof(Q), (void **)pp);
^
In file included from X:/GCC/x86_64-w64-mingw32/include/urlmon.h:289:0,
from X:/GCC/x86_64-w64-mingw32/include/objbase.h:163,
from X:/GCC/x86_64-w64-mingw32/include/ole2.h:17,
from X:/GCC/x86_64-w64-mingw32/include/wtypesbase.h:12,
from X:/GCC/x86_64-w64-mingw32/include/shlobj.h:9,
from r:\ahk\source\stdafx.h:61,
from r:\ahk\source\AutoHotkey.cpp:17:
X:/GCC/x86_64-w64-mingw32/include/servprov.h: In member function 'HRESULT IServiceProvider::QueryService(const GUID&, Q**)':
X:/GCC/x86_64-w64-mingw32/include/servprov.h:66:46: error: expected primary-expression before ')' token
return QueryService(guidService, __uuidof(Q), (void **)pp);
^
In file included from r:\ahk\source\keyboard_mouse.h:20:0,
from r:\ahk\source\hotkey.h:20,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\defines.h: At global scope:
r:\ahk\source\defines.h:388:6: error: use of enum 'BuiltInFunctionID' without previous declaration
enum BuiltInFunctionID;
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::Append(LPTSTR, size_t)':
r:\ahk\source\script_object.h:248:106: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
bool Append(LPTSTR aValue, size_t aValueLength = -1) { return Append(ExprTokenType(aValue, aValueLength)); }
^
r:\ahk\source\script_object.h:247:7: note: initializing argument 1 of 'bool Object::Append(ExprTokenType&)'
bool Append(ExprTokenType &aValue);
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::Append(long long int)':
r:\ahk\source\script_object.h:249:66: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
bool Append(__int64 aValue) { return Append(ExprTokenType(aValue)); }
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:247:7: note: initializing argument 1 of 'bool Object::Append(ExprTokenType&)'
bool Append(ExprTokenType &aValue);
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, ExprTokenType&)':
r:\ahk\source\script_object.h:313:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(ExprTokenType(aKey), aValue);
^
r:\ahk\source\script_object.h:299:7: note: initializing argument 1 of 'bool Object::SetItem(ExprTokenType&, ExprTokenType&)'
bool SetItem(ExprTokenType &aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, long long int)':
r:\ahk\source\script_object.h:318:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(aKey, ExprTokenType(aValue));
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:311:7: note: initializing argument 2 of 'bool Object::SetItem(LPTSTR, ExprTokenType&)'
bool SetItem(LPTSTR aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, IObject*)':
r:\ahk\source\script_object.h:323:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(aKey, ExprTokenType(aValue));
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:311:7: note: initializing argument 2 of 'bool Object::SetItem(LPTSTR, ExprTokenType&)'
bool SetItem(LPTSTR aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\hotkey.h:21:0,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script.h: In member function 'bool Func::ArgIsOutputVar(int)':
r:\ahk\source\script.h:1715:16: error: 'BIF_PerformAction' was not declared in this scope
if (mBIF == &BIF_PerformAction)
^
In file included from r:\ahk\source\hotkey.h:21:0,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script.h: In constructor 'Func::Func(LPTSTR, bool)':
r:\ahk\source\script.h:1803:2: error: initializations for multiple members of 'Func::<anonymous union>'
Func(LPTSTR aFuncName, bool aIsBuiltIn) // Constructor.
^
In file included from r:\ahk\source\AutoHotkey.cpp:21:0:
r:\ahk\source\TextIO.h: In member function 'long long int TextFile::Length(long long int)':
r:\ahk\source\TextIO.h:299:25: error: 'min' was not declared in this scope
_Seek(min(aLength, pos), SEEK_SET);
^
from X:/GCC/x86_64-w64-mingw32/include/objbase.h:14,
from X:/GCC/x86_64-w64-mingw32/include/ole2.h:17,
from X:/GCC/x86_64-w64-mingw32/include/wtypesbase.h:12,
from X:/GCC/x86_64-w64-mingw32/include/shlobj.h:9,
from r:\ahk\source\stdafx.h:61,
from r:\ahk\source\AutoHotkey.cpp:17:
X:/GCC/x86_64-w64-mingw32/include/unknwnbase.h: In member function 'HRESULT IUnknown::QueryInterface(Q**)':
X:/GCC/x86_64-w64-mingw32/include/unknwnbase.h:74:39: error: expected primary-expression before ')' token
return QueryInterface(__uuidof(Q), (void **)pp);
^
In file included from X:/GCC/x86_64-w64-mingw32/include/urlmon.h:289:0,
from X:/GCC/x86_64-w64-mingw32/include/objbase.h:163,
from X:/GCC/x86_64-w64-mingw32/include/ole2.h:17,
from X:/GCC/x86_64-w64-mingw32/include/wtypesbase.h:12,
from X:/GCC/x86_64-w64-mingw32/include/shlobj.h:9,
from r:\ahk\source\stdafx.h:61,
from r:\ahk\source\AutoHotkey.cpp:17:
X:/GCC/x86_64-w64-mingw32/include/servprov.h: In member function 'HRESULT IServiceProvider::QueryService(const GUID&, Q**)':
X:/GCC/x86_64-w64-mingw32/include/servprov.h:66:46: error: expected primary-expression before ')' token
return QueryService(guidService, __uuidof(Q), (void **)pp);
^
In file included from r:\ahk\source\keyboard_mouse.h:20:0,
from r:\ahk\source\hotkey.h:20,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\defines.h: At global scope:
r:\ahk\source\defines.h:388:6: error: use of enum 'BuiltInFunctionID' without previous declaration
enum BuiltInFunctionID;
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::Append(LPTSTR, size_t)':
r:\ahk\source\script_object.h:248:106: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
bool Append(LPTSTR aValue, size_t aValueLength = -1) { return Append(ExprTokenType(aValue, aValueLength)); }
^
r:\ahk\source\script_object.h:247:7: note: initializing argument 1 of 'bool Object::Append(ExprTokenType&)'
bool Append(ExprTokenType &aValue);
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::Append(long long int)':
r:\ahk\source\script_object.h:249:66: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
bool Append(__int64 aValue) { return Append(ExprTokenType(aValue)); }
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:247:7: note: initializing argument 1 of 'bool Object::Append(ExprTokenType&)'
bool Append(ExprTokenType &aValue);
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, ExprTokenType&)':
r:\ahk\source\script_object.h:313:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(ExprTokenType(aKey), aValue);
^
r:\ahk\source\script_object.h:299:7: note: initializing argument 1 of 'bool Object::SetItem(ExprTokenType&, ExprTokenType&)'
bool SetItem(ExprTokenType &aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, long long int)':
r:\ahk\source\script_object.h:318:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(aKey, ExprTokenType(aValue));
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:311:7: note: initializing argument 2 of 'bool Object::SetItem(LPTSTR, ExprTokenType&)'
bool SetItem(LPTSTR aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h: In member function 'bool Object::SetItem(LPTSTR, IObject*)':
r:\ahk\source\script_object.h:323:45: error: invalid initialization of non-const reference of type 'ExprTokenType&' from an rvalue of type 'ExprTokenType'
return SetItem(aKey, ExprTokenType(aValue));
^
In file included from r:\ahk\source\script.h:28:0,
from r:\ahk\source\hotkey.h:21,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script_object.h:311:7: note: initializing argument 2 of 'bool Object::SetItem(LPTSTR, ExprTokenType&)'
bool SetItem(LPTSTR aKey, ExprTokenType &aValue)
^
In file included from r:\ahk\source\hotkey.h:21:0,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script.h: In member function 'bool Func::ArgIsOutputVar(int)':
r:\ahk\source\script.h:1715:16: error: 'BIF_PerformAction' was not declared in this scope
if (mBIF == &BIF_PerformAction)
^
In file included from r:\ahk\source\hotkey.h:21:0,
from r:\ahk\source\hook.h:20,
from r:\ahk\source\globaldata.h:20,
from r:\ahk\source\AutoHotkey.cpp:18:
r:\ahk\source\script.h: In constructor 'Func::Func(LPTSTR, bool)':
r:\ahk\source\script.h:1803:2: error: initializations for multiple members of 'Func::<anonymous union>'
Func(LPTSTR aFuncName, bool aIsBuiltIn) // Constructor.
^
In file included from r:\ahk\source\AutoHotkey.cpp:21:0:
r:\ahk\source\TextIO.h: In member function 'long long int TextFile::Length(long long int)':
r:\ahk\source\TextIO.h:299:25: error: 'min' was not declared in this scope
_Seek(min(aLength, pos), SEEK_SET);
^
Moderators Note: Split to a seperate topic nnnik