[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
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
?
523 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
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

830 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