Share via


How can I check what .lib files are linked on my Visual C++ project?

Question

Wednesday, September 22, 2010 7:43 PM

Hi,

I know that there are bunch of different .lib and .dll files will be linked to my Visual C++ project depending on what compile option that I have selected.

For example, if I choose /MT which is static multi-thread compile option, LIBCMT.lib(C Run-time Library) and LIBCPMT.lib(Standard C++ Library) will be linked to my project.

I wanted to check which libraries are actually linked to my program for cases. For example, I wondered if I do not use any standard C++ library header files, then the project will not link LIBCPMT.lib with /MT compile option? 

So, to check that, I need to know what .lib files, which is not specified in command line, are linked to my project.

Anyone know how I can check what CRT and Standard C++ libraries are linked to any exe or dll files?

 

All replies (3)

Wednesday, September 22, 2010 9:10 PM âś…Answered

>So, to check that, I need to know what .lib files, which is not specified in command line, are linked to my project.

The linker /VERBOSE option will probably show you what you want (and a
lot more) during the link operation.

I'm not sure there is any knowledge of which static libs were used in
the actual executable.

Dave


Friday, September 24, 2010 12:01 PM

Thank you for reply. I set the /VERBOSE and I found something from Output panel when I compiled it.

 

1> Processed /DISALLOWLIB:libc.lib

1> Processed /DISALLOWLIB:libcd.lib

1> Processed /DISALLOWLIB:libcmt.lib

1> Processed /DISALLOWLIB:libcmtd.lib

1> Processed /DISALLOWLIB:msvcrt.lib

 

/DISALLOWLIB probably means 'do not load this lib', right?

 

Thank you for your answer in advance.


Friday, September 24, 2010 12:24 PM

>/DISALLOWLIB probably means 'do not load this lib', right?

Probably, but I don't know for sure, I can't spot any documentation
for it.

Dave