Linking to Static Libraries in Visual Studio 2010

What you need to know:

  • I'm sure I use the right static libraries (with dllexport and all)
  • The generated .lib files are HUGE (3M, 8M, etc.). General - about 300K-1M. Therefore, I am sure that the .lib files are static.
  • I want to link these static library files in a separate solution
  • This is an unmanaged C / C ++ project.

I read that I need to use the new interface (general properties> Add new thingy link). But for this I need to add the whole project to my solution. Is there a way to link my project with a static library (without adding source code).

+4
source share
1 answer

Add New Link is a .NET option used to add a reference to an assembly. You cannot create static link libraries in .NET, assemblies are always dynamically loaded. Suspending distrust and actually answering the question: you use the "Browse" tab in the dialog box to avoid the need to add a project to the solution.

Native projects using a static link library should use the Linker, Input, Additional Dependencies parameter. No need to add the project that generated the .lib. If you did not provide the full path to .lib, you can use Linker, General, Additional Linker Directories to tell the linker where to look for .lib

+7
source

All Articles