AHK2 alpha source. help me build

Ask for help, how to use AHK_H, etc.
bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

AHK2 alpha source. help me build

Post by bapl » 04 Aug 2022, 07:29

Hello!
I am encountering error messages when building AutoHotkey_2.0-beta.7 on this topic: viewtopic.php?f=65&t=62308
I tried VS 2017, VS 2019, VS 2022.

I get various errors everywhere.
As I understand it, I do not know what the necessary components are for the correct assembly of AHK.

Can you please explain to me what components and version are needed, as well as the "Working Load"?
Thank you!
Last edited by bapl on 07 Aug 2022, 23:27, edited 1 time in total.

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 16:13

Pls, Any help?

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 04 Aug 2022, 16:51

ahk_h isnt updated to beta7. only @thqby's fork is. so which one are u actually trying to compile? not that it matters much without knowing what errors ure getting...

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 17:00

@swagfag
I'm trying to build this project: https://github.com/thqby/AutoHotkey_H


Asks to install v143, but there is no V143 on VS2019

Code: Select all

 
How to Compile
AutoHotkey v2 is developed with Microsoft Visual Studio Community 2019, which is a free download from Microsoft.

Get the source code.
Open AutoHotkeyx.sln in Visual Studio.
Select the appropriate Build and Platform.
Build.
The project is configured in a way that allows building with Visual Studio 2012 or later. However, for the v2 branch, some newer C++ language features are used and therefore a later version of the compiler might be required.

The project is configured to use a platform toolset with "_xp" suffix, if available.
[\code]

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 04 Aug 2022, 17:10

no, there's not. v143 is VS 2022's buildtools

either download VS 2022 and compile the project with it
or downgrade the project to use v142 and see if it compiles successfully

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 17:18

@swagfag
And how to downgrade the project version?I'm just new to VS

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 04 Aug 2022, 17:25

image.png
image.png (67.9 KiB) Viewed 4480 times

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 17:31

I already have Visual Studio 2019 (v142) there.
However, when assembling, it displays an error about the need for v143, but when I installed 2022, other errors came out.
I'm confused :(

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 04 Aug 2022, 17:37

if "it displays an error about the need for v143", then by definition you dont "already have Visual Studio 2019 (v142) there". make sure u change the toolset for ALL projects. id rather this not turn into a Visual Studio techsupport...

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 17:39

@swagfag
Can you create a project yourself and write which components you used?
I have a slow internet connection and little free space on my hard drive, and every time I pump it, I've already lost two days on it.

If it's not difficult for you, of course?

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 04 Aug 2022, 18:49

image.png
image.png (17.75 KiB) Viewed 4321 times
these suffice on a fresh install. u need to read the errors to know what to do with them. if u get warnings, disable them. if u get errors, resolve them

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 04 Aug 2022, 19:07

@swagfag
And if I get errors, but eventually compilation completes and Autohotkey responds to my ahk commands.
Does this mean that the build was successful or will I soon get an error where I didn't expect it?

Sorry for my English, maybe I write like a robot, because use a translator.

Is it critical and worth fixing?
image.png
image.png (21.6 KiB) Viewed 4269 times

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 05 Aug 2022, 02:50

the warning u can ignore by turning down the warning level or disabling then entirely

the error u can fix by installing the Visual Leak Detector extension

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 05 Aug 2022, 05:05

@swagfag
I have already installed this extension, but there is a new one related to vld.lib "Unable to open vld.lib file"

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 05 Aug 2022, 05:14

then u probably dont have ur Include Paths/Libraries set up correctly. otherwise, google is ur friend
swagfag wrote:
04 Aug 2022, 17:37
:arrow: id rather this not turn into a Visual Studio techsupport...

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 05 Aug 2022, 19:43

I tried to specify direct paths to vld.lib via: Autohotkey -> properties -> Configuration Properties -> VC++ Directories: Library Directories:

Code: Select all

C:\Program Files (x86)\Visual Leak Detector\lib;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib;D:\Program Files\vcpkg\installed\$(PlatformTarget)-windows\lib
I still get the error:

Code: Select all

Error	LNK1104	cannot open file 'vld.lib'	AutoHotkey	C:\Users\bapl\Downloads\AutoHotkey_H-alpha\LINK	1
There are a lot of warnings during the build, but in the end I get only one, it turns out that such warnings can be ignored?

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Warning	MSB8004	Intermediate Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.	lib_double	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets	499	

Code: Select all

     Creating library C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\AutoHotkey.lib and object C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\AutoHotkey.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
  Generating code
  Previous IPDB not found, fall back to full compilation.
  All 2613 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
lib_pcre.lib(pcre16_fullinfo.obj) : warning LNK4099: PDB '' was not found with 'lib_pcre.lib(pcre16_fullinfo.obj)' or at ''; linking object as if no debug info
lib_pcre.lib(pcre16_globals.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_globals.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_study.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_study.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_compile.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_compile.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_exec.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_exec.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_get.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_get.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_chartables.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_chartables.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_ucd.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_ucd.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_tables.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_tables.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_string_utils.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_string_utils.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_ord2utf16.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_ord2utf16.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_valid_utf16.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_valid_utf16.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_newline.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_newline.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_pcre.lib(pcre16_xclass.obj) : warning LNK4099: PDB 'lib_pcre.pdb' was not found with 'lib_pcre.lib(pcre16_xclass.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_pcre.pdb'; linking object as if no debug info
lib_double.lib(bignum-dtoa.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(bignum-dtoa.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(bignum.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(bignum.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(cached-powers.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(cached-powers.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(diy-fp.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(diy-fp.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(double-conversion.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(double-conversion.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(fast-dtoa.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(fast-dtoa.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(fixed-dtoa.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(fixed-dtoa.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
lib_double.lib(strtod.obj) : warning LNK4099: PDB 'lib_double.pdb' was not found with 'lib_double.lib(strtod.obj)' or at 'C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\lib_double.pdb'; linking object as if no debug info
  AutoHotkeyx.vcxproj -> C:\Users\bapl\Downloads\AutoHotkey_H-alpha\bin\Win32w\AutoHotkey.exe


bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 05 Aug 2022, 23:37

Solved the problem by simply putting the library in the root of AHK.
But in some builds, there are still such errors, how can they be solved?

Code: Select all

------ Build started: Project: AutoHotkey, Configuration: ReleaseDll x64 ------
AutoHotkey.cpp
COMServer.cpp
dllmain.cpp
COMServer_i.c
C:\Users\bapl\Downloads\AutoHotkey_H-alpha\source\COMServer_i.c(65,1): warning C4005: 'MIDL_DEFINE_GUID': macro redefinition
C:\Users\bapl\Downloads\AutoHotkey_H-alpha\source\COMServer_i.c(42): message : see previous definition of 'MIDL_DEFINE_GUID'
C:\Users\bapl\Downloads\AutoHotkey_H-alpha\source\COMServer_i.c(85,1): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
Done building project "AutoHotkeyx.vcxproj" -- FAILED.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK2beta7 source. help me HotkeyIT

Post by swagfag » 06 Aug 2022, 00:13

set Use Precompiled Headers to No in the project settings

bapl
Posts: 119
Joined: 17 Apr 2021, 00:24

Re: AHK2beta7 source. help me HotkeyIT

Post by bapl » 06 Aug 2022, 00:57

@swagfag
image.png
image.png (37.82 KiB) Viewed 3693 times

User avatar
thqby
Posts: 397
Joined: 16 Apr 2021, 11:18
Contact:

Re: AHK2beta7 source. help me HotkeyIT

Post by thqby » 07 Aug 2022, 01:43

@bapl
vld is not necessary and can be removed.
v142 also works, you just need to reset it.
Currently, precompiled headers are required. (except comserver_I.c)

steps:
1. git clone
2. open sln file
3. if the toolset is missing, set Platform tool set of each project
4. switch configuration MT_Release or MT_ReleaseDll
5. compile

Post Reply

Return to “Ask for Help”