Compile ahk L or ahk h on Visual Studio 2015 Community Edition

Discuss other useful utilities, general computing tips & tricks, Internet resources, etc.
User avatar
Taurus
Posts: 94
Joined: 20 Jan 2015, 10:31

Compile ahk L or ahk h on Visual Studio 2015 Community Edition

26 Jan 2016, 11:11

Hi,

This is a Tutorial to modify and compile ahk by your self:


ahk L:

1. download and install Visual Studio Community 2015 with last Update

2. (optional) install additional language: Open VS > Tools > Options > Enviroment > Internation Settings

3. download and extract ahk L source - https://github.com/Lexikos/AutoHotkey_L ... master.zip

4. open AutoHotkey.sln and let it convert to 2015

5. Set the compile-option at the top to "Release" and press "F7" (=Build Solution)

6. Finished - now you have created your own ahk L


ahk h (without msvcr100.dll):

1. download and install Visual Studio Community 2015 with last Update

2. (optional) install additional language: Open VS > Tools > Options > Enviroment > Internation Settings

3. download and extract ahk h source - https://github.com/HotKeyIt/ahkdll/archive/master.zip

4. this libs has to be downloaded, because they need an upgrade to VS 2015:

https://github.com/TsudaKageyu/minhook/releases (infos: http://www.codeproject.com/Articles/443 ... king-Libra)

Download and extract "MinHook_133_lib.zip"

and replace ahkdll-master\source\lib\libMinHook.x64.lib + libMinHook.x86.lib

with lib\libMinHook-x64-v141-mt.lib + libMinHook-x86-v141-mt.lib (always use latest)

5. open AutoHotkey.sln and let it convert to 2015

6. in VS click Bottom Left "Property Manager" > Double Click on "AutoHotkey" > Configuration to "Release"

- C/C++ > Code Generation - set Runtime Library to "Multi-threaded (/MT) ; this removes the need of msvcr100.dll, which is a killer for using ahk h as installer

- Linker -> Manifest File -> Generate Manifest to "NO"

7. now save and Double Click on "lib_pcre"

- C/C++ > Code Generation - set Runtime Library to "Multi-threaded (/MT)

8. Set the compile-option at the top to "Release" and press "F7" (=Build Solution)

9. Finished - now you have created your own ahk L


At the moment i am testing ahk h, but looks good. So have fun! ;-)

Update 27.01.2016: this has been solved by myself
Update 09.02.2017: some improvements - Thx to guest3456
Last edited by Taurus on 09 Feb 2017, 09:15, edited 1 time in total.
:beard: Full Stack Developer > Dev for a better world | PHP for Web | AHK H for Local | with KISS (Keep IT Short and Simple) on Win 10 Pro (Version 2004) x64
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Compile ahk L or ahk h on Visual Studio 2015 Community Edition

29 Jan 2016, 12:59

thank you very much for updating the thread, and posting the step by step tutorial!

guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Compile ahk L or ahk h on Visual Studio 2015 Community Edition

28 Dec 2016, 08:24

Taurus wrote: AHK_H build...

6. in VS click Bottom Left "Property Manager" > Double Click on AutoHotkey > Configuration Properties

6.1 (optional) C/C++ > Code Generation - set Runtime Library to "Multi-threaded (/MT) ; this removes the need of msvcr100.dll, which is a killer for using ahk h as installer

6.2 (option part 2) Linker > Input - set Ignore Specific Default Libraries to "MSVCRT"
i wasn't getting an error that msvcr100.dll was missing, but rather VCRUNTIME140.dll

changing it so that it doesn't require external dll did require step 6.1 above, but 6.2 is wrong and unnecessary i believe.
you just need to do 6.1 for BOTH the AutoHotkey project as well lib_pcre

sometimes when trying to switch back and forth between /MT and /MD i was getting some fatal errors in pcre code. they would go away when i deleted the /temp and /bin folders. also remember to swap in the different libMinHooks when switching

Taurus wrote: 6.3 Manifest Tool > Input and Output > Embed Manifest - set to "No"
Update 27.01.2016: this has been solved by myself
^this solution 6.3 is wrong i think, and it doesn't work. if you choose "Embed Manifest - NO" then you get a different error.

i think the correct solution is to set "Linker -> Manifest File -> Generate Manifest" to "NO"

it is already set to "NO" on some of the configurations such as "Release". but "Release(mbcs)" was set to YES which needs to be changed

but, i've spoken to HotKeyIt about this and it looks like he's made the update so that this fix is no longer required:
https://github.com/HotKeyIt/ahkdll/comm ... d8c5d9cba1

User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Compile ahk L or ahk h on Visual Studio 2015 Community Edition

10 Apr 2019, 07:33

- Warning: use VS2017, not VS2015.
- I got this error when I tried to compile AHK_H on VS2015:

Code: Select all

C:\Users\me\Desktop\ahkdll-master\source\lib_pcre\lib_pcre.vcxproj : warning  : The build tools for v141_xp cannot be found. Install v141_xp to build using the v141_xp build tools.

C:\Users\me\Desktop\ahkdll-master\AutoHotkey.vcxproj : warning  : The build tools for v141_xp cannot be found. Install v141_xp to build using the v141_xp build tools.
- AFAIK you cannot install v141_xp for use with VS2015.
- So, going forward, you must compile AutoHotkey_H with VS2017.
- Please advise if there is a workaround, or to clarify/correct any of those statements. Thank you.

- Thanks Taurus for this guide.
- Thanks @HotKeyIt.

- Btw there is a more recent guide here:
[Guide] Compiling Ahk_h's source step by step - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=65&t=62308
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Compile ahk L or ahk h on Visual Studio 2015 Community Edition

10 Apr 2019, 09:07

With AHK_L you have a similar issue but with the toolset v150 only available on VS2015.
Recommends AHK Studio

Return to “Other Utilities & Resources”

Who is online

Users browsing this forum: No registered users and 34 guests