The following command helps compile the program:
g++ Thread.cpp main.cpp -std=c++17 -o threads.exe -lpthread
The output of the program will be as shown in the following screenshot:
Wow! We could start and stop the thread as designed and that too in an object-oriented fashion.