crt_printf, crt_scanf, ExitProcess
Windows 7 with masm32v11r for Environment Path
in .asm file, I'd like to call crt_printf to print (or call ExitProcess to end main procedure). However my code goes with:
.386
.model flat,stdcall
option casemap:none
includelib D:\masm32\lib\msvcrt.lib
printf proto C:dword,:vararg
scanf proto C:dword,:vararg
.DATA
print_int DB "%d",0
print_char DB "%c",0
and my call procedure goes with:
PUSH offset __temp13@_cal@main
PUSH offset print_string
CALL crt_printf
ADD ESP, 8
PUSH _realCock@main
PUSH offset print_int
CALL crt_printf
ADD ESP, 8
PUSH offset __temp14@_cal@main
When I Click the button of build All, messages come with:
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: D:\masm32\bin\object_code.asm
D:\masm32\bin\object_code.asm(105) : error A2006: undefined symbol : crt_printf
D:\masm32\bin\object_code.asm(109) : error A2006: undefined symbol : crt_printf
D:\masm32\bin\object_code.asm(179) : error A2006: undefined symbol : crt_scanf
D:\masm32\bin\object_code.asm(249) : error A2006: undefined symbol : ExitProcess
Assembly Error
I've struggled with such error for 24 hours, Thx!
crt_printf
is a special construct of the MASM32 developers to distiguish it from their macroprintf
. If you don't include\masm32\macros\macros.asm
you don't need this special feature:The
crt_...
aliasses are declared in themsvcrt.inc
:If you want the whole bunch with all declarations and macros then include
masm32rt.inc
: