LNK1120: 1 unresolved externals

Posted on 2000-02-29
Last Modified: 2008-02-26

My system:

My develop env.:
MSVC++ 6.x
  Not using MFC

My link´d libs (a few of them):
msvcrtd.lib, msvcrt.lib, mapi32.lib, version.lib, exchsdk.lib, user32.lib

My "#include"´s (some of them):

My problem:
libcid.lib(filebuf.obj) : error LNK2001: unresolved external symbol ___pioinfo
Debug/Xyz.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Xyz.exe - 2 error(s), 0 warning(s)

Question by:Nusse
LVL 22

Expert Comment

ID: 2570886
pioinfo is not somthing defined by the C++ standard or the windows API.  So it is probably somthing you defined, right?  if so you need to link your program to the object file (.obj) produced when you compile the code that contains pioinfo's definition.

From what little code youve' posted, it seems like it might be defined in a file called edk.cpp, is that right?  If so then you need to compile edk.cpp and link to edk.obj.  (This will be done automaticaly if edk.cpp is included as one of the files in the project.)

If that isn't enough to help, can you give us some more info to work with.
LVL 11

Accepted Solution

mikeblas earned 100 total points
ID: 2571026
You're linking the wrong libraries.

First, you should be linking either MSVCRT.LIB or MSVCRTD.LIB but not both.

If you're linking with MSVCRT[d].LIB, you should have /MD or /MDd one the compiler's command line.  I don't think you do. As a result, you're not defining _MT nor _DLL, so the standard library headers are referencing LIBCID.LIB, which causes you to need pioinfo. Normally, pioinfo comes from LIBC.LIB, But LIBC.LIB is incompatible with MSVCRT[d].LIB.

You need to either:

1) define _MT and _DLL and link with MSVCRT[d].LIB. The easiest way to do that is to quit giving the MSVCRT[d].LIB name to the linker and use /MD or /MDd on the compiler command line

2) link to LIBCI[d].LIB and LIBC[d].LIB directly, and don't link to MSVCRT[d].LIB.

NOTE: When I write SomeName[d].LIB, I mean SomeName.LIB for retail builds and SomeNameD.LIB for debug builds. Because you've got LIBCID.LIB, it's obvious this error comes from a debug build.

NOTE #2: /MD is for release builds and /MDd is for debug builds.

..B ekiM

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 199
Beginner to Unreal Engine 4 5 80
VS2015 Redefinition errors 4 52
How to convert Structure to vector of byte and vice versa 5 15
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question