I have a database which is a 2D-array(matrix) defined in 'database.h' file. This 2d-array is to be accessed in the main.cpp file and another .cpp file which performs calculations on it.
However, when I include it in the main.cpp file and the application.cpp file there is an error: redefined/ multiply defined symbols.... etc.
So, I delete the #include "database.h" from the main.cpp file and now there is another error: "
error: 'Database' was not declared in this scope "
This makes sense as the main.cpp cannot seem to access the database.h file. What is the best strategy to fix this issue? The database.h file has to be include in both main.cpp and application.cpp. I have included appropriate include guards.