views:

268

answers:

3

So I'm using Visual C++ 6.0, and trying to compile some source code, but upon compilation I get this:

Linking...
LINK : fatal error LNK1104: cannot open file "Iphlpapi.lib"
Error executing link.exe.

I'm using the correct SDK, and the directories are correct. I've checked, double checked, and triple checked. The file is the specified directory. I can't figure out what the problem is. Any ideas?

Service Pack 6

SDK for Windows Server 2003 SP1 //Sounds odd, since I'm running XP SP3, but this has worked for me in the past.

Like I've said, it worked in the past for me, flawlessly. I don't understand why it won't work now.

+2  A: 

I'm sure that you have some problems with your project configuration. Try moving that file to the folder with your source code. Check the way you add it (via input libraries) to your project. Try creating a new project and moving that .lib into your code folder (after adding it to used libraries).

Kotti
Hey, you were right. Moving the file to the folder with the source fixed it. Thanks a lot.
Rob
You are welcome :)
Kotti
@Rob: Has this really fixed it? Don't you want to fix the underlying problem next? You've only found out that the project links when the linker can find the lib when its in the source folder.
quamrana
+1  A: 

sysinternals procmon will show you where the build is looking. wont fix it but will give you a clue

pm100
+1  A: 
(tools)
(options)
(directories) tab
(show directories for ) library files

In general, you want the path that includes the missing library to be included there. so that all projects can find it.

The other option would be to add the library to your project using

(right click on the project)
(add files to project)
 browse to, and add the library

One of those two methods should do the job for you

EvilTeach