The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: m987 on March 01, 2012, 11:07:44 PM

Title: Fatal error A1000, LNK1181
Post by: m987 on March 01, 2012, 11:07:44 PM
Hi! I have a problem in masm program, I need help please. I´m trying to compile this, but when i link obj file appears this error "fatal error link181."  When I build all this appears "Fatal error A1000 cannot open file: Irvine.inc," also in the command prompt my obj and exe do not appear. I have windows 7 and 32 bit. I save the file with extension asm. Help please, Thank you.

TITLE Add and Subtract, Version 2                  (AddSub2.asm)
; This program adds and subtracts 32-bit unsigned
; integers and stores the sum in a variable.

INCLUDE Irvine32.inc

.data
val1 DWORD 10000h
val2 DWORD 40000h
val3 DWORD 20000h
finalVal DWORD ?

.code
main PROC
mov eax,val1     ; start with 10000h
add eax,val2     ; add 40000h
sub eax,val3     ; subtract 20000h
mov finalVal,eax ; store the result (30000h)
call DumpRegs    ; display the registers
exit
main ENDP
END main
Title: Re: Fatal error A1000, LNK1181
Post by: dedndave on March 01, 2012, 11:18:08 PM
it cannot locate the Irvine32.inc file
try this
        INCLUDE  \SomeFolder\Irvine32.inc
change "SomeFolder" to match your location of the INC file

if you are reading Kip's book, you may want to struggle through getting the Irvine library to work
otherwise, install the masm32 package and save yourself some trouble

http://masm32.com/masmdl.htm
Title: Re: Fatal error A1000, LNK1181
Post by: m987 on March 02, 2012, 12:25:42 AM
I already install the masm32 package, i do not know why i am still having that problem. Thank you, maybe i set up masm32 wrong i will double check it
Title: Re: Fatal error A1000, LNK1181
Post by: dedndave on March 02, 2012, 12:48:19 AM
no - Irvine32.inc/lib are not part of the masm32 package   :P

masm32 does not have a DumpRegs function, that i am aware of
but, try this...
        INCLUDE masm32\include\masm32rt.inc

        .data

val1     DWORD 10000h
val2     DWORD 40000h
val3     DWORD 20000h
finalVal DWORD ?

        .code

main    PROC

        mov     eax,val1     ; start with 10000h
        add     eax,val2     ; add 40000h
        sub     eax,val3     ; subtract 20000h
        mov     finalVal,eax ; store the result (30000h)

        print   uhex$(eax),'h',13,10
        inkey

        exit

main    ENDP

        END     main
Title: Re: Fatal error A1000, LNK1181
Post by: dedndave on March 02, 2012, 12:59:30 AM
a while back, i wrote a DumpRegs function and some other dump proc's...
some are passed parameters in register
i need to re-write them to use INVOKE   :P
Title: Re: Fatal error A1000, LNK1181
Post by: dedndave on March 02, 2012, 01:40:21 AM
here is the whole project
it is an adaptation of one of Paul Carter's book lessons
i wrote it for a friend that was interested in learning assembler
he didn't want to use the masm32 library functions and macros and i couldn't get Paul's stuff to build - lol
Title: Re: Fatal error A1000, LNK1181
Post by: m987 on March 02, 2012, 02:21:36 AM
Thank you!  :bg
Title: Re: Fatal error A1000, LNK1181
Post by: jj2007 on March 02, 2012, 06:15:49 AM
Quote from: dedndave on March 02, 2012, 12:48:19 AM
no - Irvine32.inc/lib are not part of the masm32 package   :P

Just in case Dave's project doesn't do what you need, here is a library (http://www.masm32.com/board/index.php?topic=17846.0) that combines the Irvine and Masm32 packages, i.e. you can use the macros of both packages with it.