How to check if a section of C++ code is being compiled?

Viewed 105

I'm working in a pretty large codebase, and I don't really understand how the build system works. I added a C++ function into the code, but I get an undefined reference error at runtime, which tells me the part I added may not be getting compiled.

I am wondering how I can check if a particular part of a file is being compiled or not?

2 Answers

Insert anything that would cause an error. For example:

#error

compile in debug mode run the code and add a breakpoint in the area you suspect and if its not compiled it will not let you to break there

Related