Author Topic: inkey generaes lnk2001  (Read 79 times)

mhmooney

  • Regular Member
  • *
  • Posts: 8
inkey generaes lnk2001
« on: July 13, 2020, 03:57:57 AM »
Im trying to use the inkey macro and  I get this error, getkey does the same
Ive include \masm32\macros\masm.asm

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

masm32.lib(wait_key.obj) : error LNK2001: unresolved external symbol __imp___getch
masm32.lib(wait_key.obj) : error LNK2001: unresolved external symbol __imp___kbhit
mytest.exe : fatal error LNK1120: 2 unresolved externals
_
Link error
Press any key to continue . . .






jj2007

  • Member
  • *****
  • Posts: 10438
  • Assembler is fun ;-)
    • MasmBasic
Re: inkey generaes lnk2001
« Reply #1 on: July 13, 2020, 05:51:33 AM »
Use masm32rt.inc to include also the necessary *.lib files:

Code: [Select]
include \masm32\include\masm32rt.inc
.code
start:
  inkey "all is fine"
  exit
end start

mhmooney

  • Regular Member
  • *
  • Posts: 8
Re: inkey generaes lnk2001
« Reply #2 on: July 13, 2020, 07:38:52 AM »
That did the trick, obviously there was a dependency I missed. thanks