In visual studio a object file (.obj) is generating after compiling a c++ file. How to read and understand it? Also how to see the code after compiler optimization in Visual studio 2015. Please redirect if this is already answered.
Use the DUMPBIN tool from Visual Studio command prompt. Specifically, the /DISASM
option shows you the disassembly. Do note the if you have link-time optimization enabled, then at least theoretically the final code may change after the .obj
files are linked to form the final binary (.exe
or .dll
). You can disassemble those with DUMPBIN
as well.
You're sort of asking the wrong question: you say you want to see compiler optimizations but then you draw conclusions leading you to think you .obj files are required for that. That works, as cynic's answer shows, but there are alternatives which can be handier/better depending on the situation:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With