Recently I got good programmer involved into this frequent trap. They didn't see any problem to link statically to the .LIB version but to only have a bigger module size. This is a simple reminder to expose the difference between the DLL and the .LIB version of the C Runtime library as the possible settings for code generation tab.
The best solution should be to use the DLL version and avoid most problems. But still if you feel comfortable in C and prefer the .LIB version here's this indication: memory allocation made with new and malloc should always be freed in the same module where they are allocated. It pertains only to the .LIB version. For each module (EXE or DLL) that is linked statically to the .LIB version , each module has its own chained list of memory block. The explanation is in the name : "static". When the .LIB version is linked at compile time you have separate set of global and statique variable for the module that will use them. Another time I will probably have a more complete and detailed explanation. Have a good day.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5