EDIT: FOR FUTURE VIEWERS -- See Ken White's comment for an answer. (As it turns out, the premise of my question was slightly flawed, however, this exchange may help future students as it did me.)
I have a program consisting of several cpp and several header files. I would like to understand what happens after the linker links all of these files, and preferably find a way to view the project as if it were already linked together.
Browsing through the project directory right now, I see .o files, which I know are object files. I see the individual .cpp and .h files as well as a .exe. But, to my dismay, I see no file which shows the entirety of the program. Is there one massive .cpp file that I can view? My understanding is that this file amalgamation is what happens after the linking occurs anyway, right before the compiling step happens.
Here is an analogous series of files (and the files they include), which, together make a whole program:
file: main.cpp
#include "classA.h"
#include "classB.h"
file: classA.cpp
#include "classA.h"
file: classB.cpp
#include "classB.h"
file: classA.h
file: classB.h
But what I want to view is how the code would look if at had been linked already, something like:
file: mysterious.cpp (which would contain the contents of:)
classA.h
classA.cpp
classB.h
classB.cpp
main.cpp
But altogether, with line numbers.
For context, I came up with this question while using valgrind to detect memory leaks and noting that errors seemed to be occurring at line numbers in my program which seemed too large to exist in any of the individual files.
--an inquisitive student