This is technically a little bit different because its not going to disassemble the .lib
file, but for most purposes should be good enough:
You can use /FA
switch, as described in detail here. More precisely you will probably want to use /FAs
which should produce .asm
file for each source file containing both assembly and source code, which is helpful for reference. For example if you add this to your cl
command:
cl /c /EHsc /FAs library.cpp
This should, in addition to its normal function, create a file library.asm
. This file can possibly contain a lot of stuff, so searching through it is a good idea.
If you are using Visual Studio IDE you can also set a breakpoint, start debugging and then right click a source line and choose Go To Disassembly. This option shows up in the context menu only during debugging and is active only during a break, this is why setting up a breakpoint is useful, but you can also break manually.