[Guide] Compiling Ahk_h's source step by step Topic is solved
Posted: 24 Feb 2019, 11:20
Hello, as title says this is a tutorial/guide on how to compile ahk_h's source code with Visual Studio.
English is not my main language so any corrections will be appreciated. I'm not an expert, so all these steps will be exactly what I did to compile ahk_h. (some steps might not be needed).
Requirements
Ahk_h's source: https://github.com/HotKeyIt/ahkdll
Visual Studio 2017 Community Edition: https://visualstudio.microsoft.com/es/thank-you-downloading-visual-studio/?sku=Community&rel=15
1. Installing Visual Studio 2017 Community Edition
The first time you open VS17 you will see a menu that has a lot of checkboxes.
1. Compiling ahk_h's source code
1.1. Opening source code in Visual Studio
Double click AutoHotkey.sln (file downloaded from github), wait until it finishes loading.
1.2. Setting Autohotkey as StartUp project
1.3. Compiling the source
1.4. Cleaning up and packing
Execute ahkdll-master\CleanUpAndPack.exe (file downloaded from github inside ahk_h's source)
If you don't understand what does each version mean you can check here: https://www.autohotkey.com/boards/viewtopic.php?f=65&t=73168
2. Changing default password
2.1. Getting all g_default_pwd's references
2.2. First reference (globaldata.cpp) Skip if you don't want to change password's length
2.3. Second reference (globaldata.h) Skip if you don't want to change password's length
2.4. Third reference (script.cpp) Skip if you don't want to change password's length
2.5. Eighth reference (util.cpp)
To-do
Troubleshooting:
1. "Missing dlls" and "couldn't link..." errors
Check if you followed the steps correctly. If you did then it might be because you updated Visual Studio and "$(LibraryPath)" changed to Spectre dlls but you didn't download Spectre libs.
There are 2 ways to fix it: Download Spectre library using Visual Studio Installer or inside Visual Studio do right click on "Autohotkey"->"Properties"->"C/C++"->"Code Generation" and search for "Spectre Mitigation" on the panel in the right side and change its value to "Disabled".
IMPORTANT
As said at the start EVERYTHING here was made thanks to Joe Glines's webinars, please if this guide was helpful for you go to this video like and subscribe because this guide is made by watching that video, if you liked the guide you liked the video: https://www.youtube.com/watch?v=ao5FdsqWTVQ and also part 2: https://www.youtube.com/watch?v=tiL_bIebTx4 and of course thanks to HotKeyIt for all you do for ahk's community.
Updates:
English is not my main language so any corrections will be appreciated. I'm not an expert, so all these steps will be exactly what I did to compile ahk_h. (some steps might not be needed).
Requirements
Ahk_h's source: https://github.com/HotKeyIt/ahkdll
Visual Studio 2017 Community Edition: https://visualstudio.microsoft.com/es/thank-you-downloading-visual-studio/?sku=Community&rel=15
1. Installing Visual Studio 2017 Community Edition
The first time you open VS17 you will see a menu that has a lot of checkboxes.
Make sure to check all those boxes on the image
1. Compiling ahk_h's source code
1.1. Opening source code in Visual Studio
Double click AutoHotkey.sln (file downloaded from github), wait until it finishes loading.
1.2. Setting Autohotkey as StartUp project
Right click Autohotkey and click on "Set as StartUp project"
1.3. Compiling the source
Click on Build -> Batch Build...
Check the following boxes
Once you have done that click on "Build" and wait until it finishes. (it might take like 5 minutes).1.4. Cleaning up and packing
Execute ahkdll-master\CleanUpAndPack.exe (file downloaded from github inside ahk_h's source)
Then go to ahkdll-master\bin and you will see 6 folders
If you don't understand what does each version mean you can check here: https://www.autohotkey.com/boards/viewtopic.php?f=65&t=73168
2. Changing default password
2.1. Getting all g_default_pwd's references
2.1.1. On the left side of the screen double click on "Autohotkey" then double click on "Source Files" and then double click on "utils.cpp"
2.1.2 Press ctrl+f, set the search to current document and search "g_default_pwd"
2.1.3 Right click on "g_default_pwd" and select "Find All References"
2.2. First reference (globaldata.cpp) Skip if you don't want to change password's length
2.2.1 Click the 1st reference
2.3. Second reference (globaldata.h) Skip if you don't want to change password's length
2.3.1 Click the 2nd reference
2.4. Third reference (script.cpp) Skip if you don't want to change password's length
2.4.1 Click the 3rd reference
2.5. Eighth reference (util.cpp)
2.4.1 Click the 8th reference
To-do
- Add how to make a dynamic password.
Troubleshooting:
1. "Missing dlls" and "couldn't link..." errors
Check if you followed the steps correctly. If you did then it might be because you updated Visual Studio and "$(LibraryPath)" changed to Spectre dlls but you didn't download Spectre libs.
There are 2 ways to fix it: Download Spectre library using Visual Studio Installer or inside Visual Studio do right click on "Autohotkey"->"Properties"->"C/C++"->"Code Generation" and search for "Spectre Mitigation" on the panel in the right side and change its value to "Disabled".
IMPORTANT
As said at the start EVERYTHING here was made thanks to Joe Glines's webinars, please if this guide was helpful for you go to this video like and subscribe because this guide is made by watching that video, if you liked the guide you liked the video: https://www.youtube.com/watch?v=ao5FdsqWTVQ and also part 2: https://www.youtube.com/watch?v=tiL_bIebTx4 and of course thanks to HotKeyIt for all you do for ahk's community.
Updates:
- I forgot to thank HotKeyIt for making everything possible.
- Added a Troubleshoot section
- Updated step 2
- Deleted Troubleshoot section as it was not needed anymore, added how to change password.
- Fixed a typo in step 2.5
- Added Troubleshoot section again .
- Updated to new version of ahk_h
Old guide