I'm a beginner in programming, I wonder what is inside the .o files and want to see it, but can't open the files in windows because they give some output with unrecognized symbols. Please suggest something !
- You don't open seem ;-) see full response in the linked answer above. Welcome to stack overflow !elcuco– elcuco2019-08-08 06:30:10 +00:00Commented Aug 8, 2019 at 6:30
- I think this will answer your question. stackoverflow.com/questions/2186246/what-is-o-fileuser4957000– user49570002019-08-08 06:30:43 +00:00Commented Aug 8, 2019 at 6:30
Add a comment |
1 Answer
They are object files, produced by the compiler, which the linker will combine into an executable.
They are not intended to be human readable.
5 Comments
the busybee
Depending on the compiler system you are using, there might be tools that can show you some of the information in an object file in a human readable form. For GCC it is
objdump, for example.hackeroid
can't we open them anyway, just to see what's inside of those .o files
Mawg
Yes, you can, but you are unlikely to understand the contents. Give it a try
hackeroid
I did open it and saw some unreadable format using certain special characters etc, but why is it that we can't read the code moreover if this is the code that our cpu understands then why isn't it in 0s and 1s because that's what our computers understand
Mawg
It is in ones and zeros. Try looking in a hex editor, although ever then you will only byte by byte, rather than bit by bit.. But your CPU doesn't look at it bit by bit either, probably in chunks of 64 bits.