News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

LNK2001 error Irvine32.inc

Started by woodycarson, February 18, 2015, 10:06:38 AM

Previous topic - Next topic

woodycarson

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.

woodycarson

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?

dedndave

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

jj2007

#3
For fans of Kip, here is his latest book (March 2014) at Amazon.