Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore specific libraries for crt libraries?

In a very old code base, we have some build settings for our visual C++ project settings that are confusing and seemingly not necessary.

Our C++ projects are built with visual studio (Currently using vs 2010) and in the linker options there are a few libraries specified for the 'ignore specific libraries' linker setting. Some of these libraries are: msvcirt.lib and msvcrtd.lib.

So for the question: I can't figure out for the life of me why ignoring these specific libraries would be necessary?

My best guess is that: Perhaps it was necessary back in the early days of visual studio? ... for some weird reason known only to the folks who put it in.

By default, using VS 2010 to make a C/C++ project (i.e. .vcxproj) those libraries are not specifically ignored. Therefore I'm 99% sure that this linker setting is not necessary 99% of the time. Does anyone agree with me in this?

When I use dependency walker to inspect any old DLL that I build, I can see that if I link in ADVAPI32.dll that it was a dependency on msvcrt.dll. But that should really be none of my concern...

like image 673
C Johnson Avatar asked Oct 22 '25 03:10

C Johnson


1 Answers

There are situation where there are conflicts in core libraries when you link multiple libraries that were compiled differently.

I've encountered some problems where i had to use that when compiling C++/CLI with the /clr flag.

A few examples:

Difficulty Building with Visual Studio 2010

Visual Studio .NET 2003 - Ignore Specific Library for libcmt vs libcmtd

like image 102
Yochai Timmer Avatar answered Oct 24 '25 03:10

Yochai Timmer