Solved

LNK1120: 1 unresolved externals

Posted on 2000-02-29
2
1,267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

707 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