Solved

LNK1120: 1 unresolved externals

Posted on 2000-02-29
2
1,221 Views
Last Modified: 2008-02-26
Hi

My system:
WinNT4.x

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):
<iostream.h>
<fstream.h>
"edk.h"
<string.h>

My problem:
Linking...
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)

0
Comment
Question by:Nusse
2 Comments
 
LVL 22

Expert Comment

by:nietod
Comment Utility
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.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
Comment Utility
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
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now