Hack Forums
[Assembly] Irvine library SmallWin.inc error MASM Visual Studio 2015 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Assembly] Irvine library SmallWin.inc error MASM Visual Studio 2015 (/showthread.php?tid=5441207)



Irvine library SmallWin.inc error MASM Visual Studio 2015 - ISM34 - Oct 22, 2016

I am trying to run the following code in Visual Studio 2015 that has MASM built in to it. I am trying to link the Irvine library files to the program. However, I get like 49 of the following errors.

Code
A2C \Irvine\SmallWin.inc(11)or specified size
A2C \Irvine\SmallWin.inc(12)or specified size
A2C \Irvine\SmallWin.inc(299)for specified size

Here is my code

Code
ExitProcess PROTO

includelib C:\Irvine\Kernel32.Lib
includelib C:\Irvine\User32.Lib
includelib C:\Irvine\Irvine32.lib
include Irvine32.inc

.data
str1 BYTE "This line is displayed in color",0

.code
main PROC

    mov eax, black + (white * 16) ; black on white backgrouund
    mov ecx,4 ; loop counter

L1: call SetTextColor
    mov edx,OFFSET str1
    call WriteString
    call Crlf
    add eax,2 ; add 2 to foreground color
    loop L1

    call ExitProcess
main ENDP
END



* - taktaktak - Oct 22, 2016

Seems like Irvine32.inc is trying to reference other files that would normally be in the same directory as it. Try keeping Irvine32.inc in it's source directory, or move it into whatever directory those files that are missing are located at.


* - ISM34 - Oct 24, 2016

Thank you for your help, I appreciate your response. I downloaded MASM32 SDK and tried running the following code:
Code
.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc

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

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

include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib


.data
str1 BYTE "This line is displayed in color",0

.code
start:

    mov eax, black + (white * 16) ; black on white backgrouund
    mov ecx,4 ; loop counter

L1: call SetTextColor
    mov edx,OFFSET str1
    call WriteString
    call Crlf
    add eax,2 ; add 2 to foreground color
    loop L1


END start

I receive the following error message:
Code
error A2006: undefined symbol: black
error A2006: undefined symbol: SetTextColor
error A2006: undefined symbol: WriteString
error A2006: undefined symbol: Crlf

Since I am trying to use the Irvine library functionality, do I need to include these lines of code?
Code
include \Irvine\Irvine32.inc
includelib \Irvine\Irvine32.lib

I appreciate all the help you can give.


* - HFDone - Oct 24, 2016

include irvine\macros.inc


* - ISM34 - Oct 25, 2016

No worries, I figured it out. I compiled and ran the code.