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
514 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 500 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
  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 clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

733 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