The MASM Forum

General => The Campus => Topic started by: mhmooney on July 13, 2020, 03:57:57 AM

Title: inkey generaes lnk2001
Post by: mhmooney 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 . . .





Title: Re: inkey generaes lnk2001
Post by: jj2007 on July 13, 2020, 05:51:33 AM
Use masm32rt.inc to include also the necessary *.lib files:

include \masm32\include\masm32rt.inc
.code
start:
  inkey "all is fine"
  exit
end start
Title: Re: inkey generaes lnk2001
Post by: mhmooney on July 13, 2020, 07:38:52 AM
That did the trick, obviously there was a dependency I missed. thanks