?
Solved

Add/Link home grown dll to a project

Posted on 2014-01-14
7
Medium Priority
?
507 Views
Last Modified: 2014-01-16
I have created a dll, and would like to link that to a project that I am working on,  The MSDN documents suggest that I use Project->References->Common Properties->Add New Reference, but when I do, there is nothing there.  MSDN also suggests that I press the BROWSE button, but that button doesn't exist.

Any help will be greatly appreciated.
0
Comment
Question by:rickhill11
[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
  • 4
  • 2
7 Comments
 
LVL 3

Expert Comment

by:fredvr666
ID: 39779434
What version of Visual studio you are using?
0
 

Author Comment

by:rickhill11
ID: 39779437
Sorry, VS2012 VC++
0
 

Author Comment

by:rickhill11
ID: 39779562
When I click on Add New Referenced I get a new dialog with "No items found", and there is not a Browse button.
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:rickhill11
ID: 39779624
I used the old fashioned way referenced in the document which worked.  But I still wonder why Add New Reference doesn't work.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 39779860
Hi rickhill11,

before you can use Add New Reference you have to add the DLL's project to the solution. I don't exactly know how this works in VS 2012, in VS 2010 you i.e. can use menu File->Add->Existing Project and select the VCXPROJ file of your DLL's project.

ZOPPO
0
 

Author Comment

by:rickhill11
ID: 39779949
Worked perfectly, Thanks!


Some of the resultant software will be distributed via Dropbox, and I don't want to have to keep track of DLLs on other people's computer.  How can I make a specific project statically link the project that I added via "Add New Reference?"
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 2000 total points
ID: 39779987
Hm - to do this you'll have to change the DLL project's settings to build a static library instead of a DLL.

Usually that's not a big deal. I would suggest to add a configurations like i.e. Release Static (as copy from Release) and Debug Static (as copy from Debug). If you think you won't every need to use the project as a DLL you can skip this, in this case simply ignore these new names below and change the mentioned settings directly in Release and Debug.

In these two new configurations then change the project settings Configuration Properties->General->Configuration Type from Dynamic Library (.dll) to Static Library (.lib).

Further if you really want to only distribute the EXE you should link the runtime (and, if used, MFC too) statically into the EXE too.

To link Runtime Libraries statically set Configuration Properties->C/C++->Code Generation->Runtime Library to Multi-threaded (/MT) in Release Static and Multi-threaded Debug (/MTd) in DebugStatic.

To link MFC statically set Configuration Properties->General->Use of MFC to Use MFC in a Static Library.

At last you may have to configure the new configuration is used in Build->Configuration Manager ... - there simply for the DLL-project select Release Static for the solution's Release configuration and Debug Static for the solution's Debug configuration.

Usually this is enough to linke everything needed into one single EXE. Please take care I only can tell how it is in VS 2010, it maybe some menue items or property names may differ in VS 2012.

Hope this helps,

ZOPPO
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

765 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