The MASM Forum

Miscellaneous => Irvine Book Questions. => Topic started by: woodycarson on February 18, 2015, 10:06:38 AM

Title: LNK2001 error Irvine32.inc
Post by: woodycarson on February 18, 2015, 10:06:38 AM
First off, hello, I am new to the forum.

I'm in an assembly class using Irvine's book. I'm having troubles using ml.exe and link.exe.
C:\masm32\bin>ml /c /coff /Fo C:\Users\virtschool\Desktop\prog1\prog.obj C:\Users\virtschool\Desktop\prog1\prog.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\Users\virtschool\Desktop\prog1\prog.asm

C:\masm32\bin>link /subsystem:console C:\Users\virtschool\Desktop\prog1\prog.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

prog.obj : error LNK2001: unresolved external symbol _ExitProcess@4
prog.obj : error LNK2001: unresolved external symbol _Crlf@0
prog.obj : error LNK2001: unresolved external symbol _ParseInteger32@0
prog.obj : error LNK2001: unresolved external symbol _ReadString@0
prog.obj : error LNK2001: unresolved external symbol _WriteInt@0
prog.obj : error LNK2001: unresolved external symbol _WriteString@0
prog.exe : fatal error LNK1120: 6 unresolved externals


I know this program works because it ran on my professor's computer. Only difference is that he ran it from within Visual Studio 2010. I'm using the same Irvine32 library.

I'm guessing that I'm missing some arguments for link or ml, but I can't tell just from looking at the MSDN pages for either.
Title: Re: LNK2001 error Irvine32.inc
Post by: woodycarson on February 18, 2015, 10:26:22 AM
I always manage to figure out questions I ask right after I post them.

anyways adding these lines fixes the issue:
includelib \Irvine\Irvine32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib


Why didn't those have to be included in VS 2010?
Title: Re: LNK2001 error Irvine32.inc
Post by: dedndave on February 18, 2015, 10:46:15 AM
well - they are included in vs, as well - you just don't see them
they are in a project files someplace - or perhaps, handled with environment variables
if you look at Kip's site, there is a page about how to set up vs to use with his libraries
you will see that the LIB and INCLUDE environment variables are set

so - if you don't have the same environment, you have to add them explicitly
Title: Re: LNK2001 error Irvine32.inc
Post by: jj2007 on February 19, 2015, 03:50:50 PM
For fans of Kip, here is his latest book (March 2014) at Amazon (http://www.amazon.com/Assembly-Language-x86-Processors-7th/dp/0133769402/ref=sr_1_1?s=books&ie=UTF8&qid=1424321479&sr=1-1&keywords=Assembly+Language+for+x86+Processors+%287th+Edition%29).