1

This post and this post says that with Visual Studio, the run time library can be static/dynamic, and it shouldn't be mixed. Even one can have debugging version/release version for the library. And there are four possibilities (static/dynamic and debug/release).

So, with Visual Studio, the library provider has to provide four different versions of the same library?

ADDED

I tried to link CppUnit test (debug) with release build library, and I got an error. So, I wondered normally library provider might need to provide all the possible combination of libraries.

Community
  • 1
  • 1
prosseek
  • 155,475
  • 189
  • 518
  • 818

2 Answers2

2

This is really the case with ANY C++ library (we have the same 4 options in our Unix side builds).

Please note that you only have to provide the debug versions if you intend them to be used by other developers, who will need them to debug - otherwise, for end users, you can only provide optimized ones.

DVK
  • 119,765
  • 29
  • 201
  • 317
2

depends.. under normal cicrcumstances you only provide a realease version. Then you have the option for static/dynamic. In the case of static, you don't have to provide anything since it's static: your lib already contains all functions from the crt it needs. In case of dynamic, it also depends: if you expect your clients to build applications using your lib, they already should have the required lib on their build machine. Else, yes, you can provide them with a crt installer for the dynamic release version (or just ship the corresponding dlls but that's considered rather bad practice)

Also if I remember correctly, you cannot redistribute the debug versions of VS's debug libraries, so in the end this would mean the library provider should only provide one version.

stijn
  • 31,563
  • 13
  • 95
  • 145
  • Is it OK to make debug build to link against library built with release option? I'm not sure, but I remember getting an error when I tried this. – prosseek Jan 11 '11 at 17:05
  • depends.. for example the kernel32.lib you and I have is definitely the relase version and it obviously doesn't create problems when using it for debug builds. However for the crt libs this is different, even if it compiles (it didn't in your previous question :P) you can get into trouble for example when calling delete on an object allocated with new in the debug lib. – stijn Jan 11 '11 at 17:14
  • I see. The CppUnit test relies on crt libs. I guess, for libs using crt, one should provide both for debug/release anyway. – prosseek Jan 11 '11 at 17:19