Structor error LNK2019

Old Topics related to the original "AutoGUI" ahk script editor.
xroot
Posts: 40
Joined: 21 Jun 2019, 08:45

Structor error LNK2019

Post by xroot » 26 Mar 2020, 08:56

What am I doing wrong, compiling WNDCLASSEXW
32 bit offset works fine
64 bit offset I get this
Offsets.obj : error LNK2019: unresolved external symbol _printf referenced in function _main
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
Offsets64.exe : fatal error LNK1120: 2 unresolved externals
Structure Declaration

Code: Select all

typedef struct tagWNDCLASSEXW {
  UINT      cbSize;
  UINT      style;
  WNDPROC   lpfnWndProc;
  int       cbClsExtra;
  int       cbWndExtra;
  HINSTANCE hInstance;
  HICON     hIcon;
  HCURSOR   hCursor;
  HBRUSH    hbrBackground;
  LPCWSTR   lpszMenuName;
  LPCWSTR   lpszClassName;
  HICON     hIconSm;
} 

User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Structor error LNK2019

Post by Alguimist » 27 Mar 2020, 07:40

32 bit offset works fine? Make sure that both compiler architectures are working fine. Keys F2-F4 provide samples for testing.

The structure name is being omitted at the end of the declaration.

WNDCLASSEXW:

Code: Select all

typedef struct tagWNDCLASSEXW {
  UINT      cbSize;
  UINT      style;
  WNDPROC   lpfnWndProc;
  int       cbClsExtra;
  int       cbWndExtra;
  HINSTANCE hInstance;
  HICON     hIcon;
  HCURSOR   hCursor;
  HBRUSH    hbrBackground;
  LPCWSTR   lpszMenuName;
  LPCWSTR   lpszClassName;
  HICON     hIconSm;
} WNDCLASSEXW, *PWNDCLASSEXW, *NPWNDCLASSEXW, *LPWNDCLASSEXW;
You can also change the following line in the script to deal with that:

Code: Select all

} Else If (RegExMatch(Line, "struct (\w+)", Match)) {

Code: Select all

} Else If (RegExMatch(Line, "struct (?:tag)?(\w+)", Match)) {

Post Reply

Return to “Old Topics”