1

I'm happy with dynamic linking while creating small c++ windows applications. But now I need to add a third part library. I have both a dll and a lib file. I prefer not to copy third party dll each time I install my application. Can I somehow link newly provided library statically while keeping whole project dynamically linked? In Microsoft Visual Studio IDE I found only one place where I can choose static/dynamic linking, in Properties->Configuration Properties->Code Generation->Runtime Library. But I suppose this selection is for the whole project and I need to link some libs statically and some of them dynamically.

UPDATE

In general I need to link some libs dynamically and others statically in the same project. The provided link tells only about static or dynamic linking in the same project

manatttta
  • 3,054
  • 4
  • 34
  • 72
vico
  • 17,051
  • 45
  • 159
  • 315
  • 1
    Possible duplicate of [Linking with both static and dynamic libraries in MSVC](http://stackoverflow.com/questions/1009098/linking-with-both-static-and-dynamic-libraries-in-msvc) – IKavanagh Sep 21 '15 at 10:47
  • In general I need to link some libs dynamically and some statically in the same project. Provided link tells only about static or dynamic linking in the same project – vico Sep 21 '15 at 11:07
  • Short: developer version of DLL has in pair LIB (with import only). You link static this lib, but final app is dynamic. Long: follow this link – Jacek Cz Sep 21 '15 at 11:13
  • `I prefer not to copy third party dll each time` Too bad; if you want to use the DLL, you would of course have to deploy it. `Can I somehow link newly provided library statically` No you cannot. That's why it's called a Dynamic Link Library. If you really need to, you would have to contact the vendor and ask them to give you a static library (built for your particular compiler version and settings), or else source code so that you can built that static library yourself. – Igor Tandetnik Sep 21 '15 at 13:43

0 Answers0