I am programming using assembler in Console Mode.
I have run across the following oddity.

There are several Functions that I use that when I
first used them I got an message from the linker
indicating unresolved references.

Two functions that did this are:
CreateFile and WriteConsole.
I was able to link them by calling the functions as:

CreateFileA and WriteConsoleA.

Yesterday I attempted to use the function
HeapRealloc and got the same message about
unresolved reference. I tried adding A to the end
and it did not work and I tried B,C,D and also 0,1
None worked. All the other Memory Allocaiton
functions work.

And today I got the same result trying to use

ReadConsoleOutput - and again adding the A did
not work.

Can anyone illuminate what is going on here.

I am linking to kernel32.lib 2/5/97 637502 bytes
Posted on 2002-02-18 13:57:05 by nolpak
Its too little info to decide :)

The A suffix if for non Unicode functions but your include should handle that... unless..

What assembler are you using?
what linker?
what are the command line parameters?
what include files are you using?
Posted on 2002-02-18 14:42:46 by BogdanOntanu
Below are the lines from a BAT fle I use to Assembler
and Link.
ml.exe and link.exe are from the most recet MASM32
MASM32 listing.

f:\masm32\bin\ml /nologo /c /coff %1.asm
f:\masm32\bin\link /nologo -subsystem:Console -entry:_start -out:%1.exe %1.obj nt_sdk\lib\kernel32.lib nt_sdk\lib\user32.lib nt_sdk\lib\gdi32.lib nt_sdk\lib\winspool.lib

There are other include file but they are ones created
by me for files I use.
INCLUDE windows.inc

It seems to me that the anomaly is associated with the fact that I cna use all the Memory functions, indluding
HeapCreate, HeapFree, HeapDestroy, etc but I hve
this problem only with HeapRealloc.

HeapRealloc certainly has nothing to do with any
language specific aspects.

I remain puzzled

Thanks for your interest.
Posted on 2002-02-18 18:32:00 by nolpak
To use CreateFileA and WriteConsoleA, you must include below.

include c:\masm32\include\kernel32.inc
includelib c:\masm32\lib\kernel32.lib

you can find it's prototype in kernel32.inc.

and "A" means Ascii-one byte string process method,
"W" means Wide Character-two byte strings as i understand.
Posted on 2002-02-18 19:06:05 by muzidowa