?
Solved

LNK1120: 1 unresolved externals

Posted on 2000-02-29
2
Medium Priority
?
1,313 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
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.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 300 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
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 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.
Suggested Courses

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