0

I am new to assembly and am trying to link Irvine32 library to a program to output colored characters using SetTextColor, i am using MASM 32

.486                                   ; create 32 bit code
option casemap :none                   ; case sensitive

include \Irvine\Irvine32.inc
include \Irvine\Macros.inc
includelib \Irvine\kernel32.lib
includelib \Irvine\Irvine32.lib

ExitProcess Proto, dwExitCode:DWORD
.code                       ; Tell MASM where the code starts
start:

mov al,'o'
mov eax,yellow + (blue +16)
call SetTextColor
call WriteChar

INVOKE ExitProcess,0        ;endprocess once complete
end start                       ;Tell MASM where the program ends

when I click console assemble and link i get this error message

Irvine32.lib(Irvine32.obj) : error LNK2001: unresolved external symbol _MessageBoxA@16
cshprog4.exe : fatal error LNK1120: 1 unresolved externals

cshprog4 is the name of my program. what can i do to fix this error?

  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Ken White Apr 29 '16 at 23:55
  • If you have a file `\Irvine\user32.lib` then you should add this to your program `includelib \Irvine\user32.lib` . I'd also recommend adding this too `include \Irvine\user32.inc` assuming that file exists in \Irvine . You may have it in a subdirectory, I can't tell. – Michael Petch Apr 30 '16 at 00:25
  • that totally worked! I figured it was just me missing something obvious. thanks a bunch! – Caleb Herboth May 02 '16 at 02:21

0 Answers0