Compiling separate files from project

Hello everyone,
beginner CPP question here: I am looking to understand a big project composed of hundreds of .cpp and .hpp files. The project as a whole includes a makefile that compiles and links everything together. However, I would like run the code of different components on this application in order to see how each part works individually and then better understand how they all work together.
The file I want to test is "Address.cpp", which itself includes:
Address.cpp
1
2
3
4
5
#include "Address.hpp"
#include "NoteEncryption.hpp"
#include "hash.h"
#include "prf.h"
#include "streams.h" 

then
Address.hpp
1
2
3
#include "uint256.h"
#include "uint252.h"
#include "serialize.h" 

etc..
I wanted to make a file "test.cpp" that uses the functions and variables inside of "Address.cpp" but am not sure how to do this. Do I only need to include "Address.cpp" and "Address.hpp" on the "test.cpp" file, and then compile normally?

You would need to include "Address.hpp" in "test.cpp". When you build your test runner, you also need to compile "Address.cpp" and link the object code into your program.
Topic archived. No new replies allowed.