Q:

Generate header of view .obj file

Is there a way to generate a c++ header file for an .obj file? Or perhaps is there an utility that can view .obj files. I've already found objconv that converts between formats, but I can't find any .h generator/viewer.

A:

Given the C++ tag, the situation isn't quite as hopeless as some of the other answers imply.
In particular, at least with most C++ compilers, the name of a function will be mangled (Microsoft calls it "decorated") to indicate the parameters taken by that function. The mangling scheme varies from one compiler to another, but essentially any of them encodes enough information for you to re-create a declaration for the function -- the return type, the name of the function itself, the class name if it's a member function, and the exact number and type of parameters the function expects.
Though it wouldn't have to be done by mangling the name, a C++ system has no real choice but to include parameter information in the object file. When you overload functions, the linker needs some way to sort out which overload to link up with a particular call.
I should add that sorting this all out may be quite a bit of work though -- just for example, if the code includes templates, the symbol name in the object file will expand out all the template parameters (including default parameters). Just for example, consider a trivial bit of code like this:
#include <vector>
#include <string>

std::vector<std::string> x;

When I compile this with VC++, and then do dumpbin /symbols foo.obj, the output is about 75 kilobytes. Even though my source code only appears to define one symbol, the object file contains definitions for around 180 symbols, many of them almost completely unrelated to anything I wrote at all.
It's also worth mentioning that if the object file was compiled with debugging information, that will (normally) produce substantially more type information (and such) in the object file as well.

