You are here:

C++/Lib files and linking!?


QUESTION: I am a late beginner, early intermediate c++ programmer and i am having a hell of a time trying to figure out how lib files work and such. My question is, i have a solution that contains 2 dll projects. On one project (client.dll), i have a class that i need to access in the other project (server.dll). I believe i have the code all setup properly and when i compile, the server.dll states "LNK2001 unresolved external symbol: "class IInput * input"

Now, how am i supposed to link the "class IInput * input" symbol in client.dll project to server.dll project?
There is almost no currenly existing documentation that explains lib.exe and linking as pertaining to what i need to know. Would love some help, or even a little hint!

ANSWER: The pointer variable "input" is not defined in server.dll. You may need to link library containing definition of client.dll. Refer to the documentation in Visual Studio on how to link libraries.

Linking libraries is one of the most dirty things, and it can get complicated. Just put in some more clear thinking and effort. If unable to resolve, get back to me.

---------- FOLLOW-UP ----------

QUESTION: Okay, here is where i am at currently:

I have no hair left.
I need the member function CInput::CAM_IsThirdPerson() in the client project to be accessible to gamerules.cpp file in server project. I have a couple of .lib files custom to the game avaiable before i compile. After i compile, in the "release" file that is created, there are all the .obj files the server.dll (or client.dll), and the server.lib (or client.lib)

Now, the documentation helped orient me a little, but helped me in no way with how or what, to link to what, in C++. Everything looked like it was in basic (DECLARE INTEGER CAM_function() IN client) and never involed lib.exe command line.

What am i supposed to link to and how? Do i use lib.exe command line to link, and what files do i need to link, and how do i link them?

Please relax. Be calm.

1. You have to be clear about the dependencies of your executables. Why are there cross dependencies? Have you added these dependencies - are they intentional or accidental?

2. You're looking at the wrong documentation - dont look at Basic. You dont need to use lib.exe for linking. If you're using Visual Studio, look at and links at

It might be worthwhile to show your code and build steps to a friend who can help, in person.


All Answers

Answers by Expert:

Ask Experts


Amit Kumar


I can answer Cplusplus language and library questions, including STL, ACE, Boost. I have a good background in Mathematics.


Programming in CPP for about 8 years. Industry experience of 4 years.

Bachelors and Masters in Computer Science from Indian Institute of Technology Delhi.

©2016 All rights reserved.