News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Unresolved external symbol '_wait_key@0'

Started by anta40, August 21, 2014, 12:43:29 AM

Previous topic - Next topic

anta40


include \masm32\include\masm32rt.inc
includelib \masm32\lib\masm32.lib

.code
start:
    print "Hello world from MASM32...",13,10,0
    inkey
    exit

end start


both MS link (12.00.21005.1) and polink (8.00.1) give the same error message:
Quote
error LNK2001: unresolved external symbol _wait_key@0

Of course, the culprint is inkey.
in which lib the _wait_key function is defined?

qWord

Try to check if masm32.lib does exist in the lib directory.
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

Works fine on a normal Masm32 installation. The includelib line is not needed, though.

As qWord wrote, check if the lib file exists. If not, reinstall everything (no, not Windows, just Masm32), and next time treat the Masm32 folders as read-only 8)

qWord

just reconsider it: if the lib does not exist, the linker would complain. Maybe something when wrong when building the lib, e.g. the AV removed the corresponding object file.
MREAL macros - when you need floating point arithmetic while assembling!

anta40

Quote from: qWord on August 21, 2014, 01:35:17 AM
Maybe something when wrong when building the lib, e.g. the AV removed the corresponding object file.

You hit the spot.
I tried to rebuild masm32.lib by running make.bat and some errors occured.
So I tried running the commands manually and masm32.lib successfully built without errors.

Oh well, at least my problem solved. Thank you :biggrin:

Vortex

Hi anta40,

What are the error messages you receive after running :\masm32\m32lib\make.bat ?

anta40

Hi vortex,

I tried rebuilding masm32.lib once again and there are the errors:
Quote
***********
ASCII build
***********

Assembling: fptoa.asm
fptoa.asm(75) : error A2023:instruction operand must have size
Assembling: fptoa2.asm
fptoa2.asm(74) : error A2023:instruction operand must have size
Assembling: frame3d.asm
Assembling: framegrp.asm

***********

*************
UNICODE Build
*************

Assembling: ucgetline.asm
Assembling: ucleft.asm
Assembling: uclen.asm
Assembling: uclower.asm
Assembling: ucltrim.asm
Assembling: ucmid.asm
Assembling: ucMonoSpace.asm
Assembling: ucmulcat.asm
Assembling: ucremove.asm
Assembling: ucrep.asm
Assembling: ucrev.asm
Assembling: ucright.asm
ucright.asm(7) : fatal error A1000:cannot open file : masm32.inc

The second error, which is related to masm32.inc, can be solved easily by copying masm32.inc first before running make.bat
Not sure about the first one. FYI, I'm using ml version 12.00.21005.1

hutch--

#7
See if the library builds with the old version. 6.14. If it does then its a difference with the later version of ML. If you get the same errors its a problem with your computer's configuration. UAC or AV scanner being the usual culprit.

qWord

Later MASM versions are more strict on size/type constrains for some instructions. In this case it is FBSTP, which requires a TBYTE-sized operand: fbstp TBYTE ptr [esp].
MREAL macros - when you need floating point arithmetic while assembling!