?
Solved

How do I change a Visual C++ project from a static lib to a DLL in a VS2010 solution

Posted on 2011-09-06
1
Medium Priority
?
519 Views
Last Modified: 2012-05-12
I have a working Visual Studio 2010 solution with two projects.  The main project includes the second project as a reference.  


I converted the second project from a static LIB to a DLL.  I removed the original reference from the main project in the solution and re-added it.  The second project DLL successfully builds and lands in the Release and Debug folders.

When I build the solution I now get a linker error:

LNK1181: cannot open input file C:\Release\MyLib.Lib

When I inspect the linker command line, it still references the LIB file instead of the DLL.

Is there a linker setting that should be changed to recognize the DLL?

0
Comment
Question by:MDKIMZEY
[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
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 36490069
The DLL it refers to the so called "import library" (http://msdn.microsoft.com/en-US/library/f0z8kac4%28v=VS.100%29.aspx - sums that up) which is created when building the DLL, you'll find it in the same folder as the DLL itself. Just copy it to the folder where your other project expects it and you will be fine.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  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 …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

762 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