How to use in included files
flamedmg opened this issue · comments
Dmitry M. Gavrovsky commented
C++ newb here. Could you please suggest or show small example of how to use logger if code consists of 3 files:
- main.cpp
- lib.cpp
- lib.h
If i import RemoteDebug in lib.cpp, how do i use it later in main.cpp ? In my case there are way more files that needs access to that logger, but because debugV or other methods requires Debug variable i'm not sure how to use it.
Matias Gea commented
I use a "Globals.h" file to do so, that consists of:
#include "RemoteDebug.h"
...
extern RemoteDebug Debug;
...
Then I include that one in all the files I need and use it normally.
Max commented
Mh still says undefined reference to
Debug'` where are you initializing your debug instance ?