RemoteDebug icon indicating copy to clipboard operation
RemoteDebug copied to clipboard

How to use in included files

Open flamedmg opened this issue 5 years ago • 2 comments

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.

flamedmg avatar Jul 02 '20 19:07 flamedmg

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.

mfgea avatar Jul 07 '20 18:07 mfgea

Mh still says undefined reference to Debug'` where are you initializing your debug instance ?

maxiangelo avatar Apr 07 '21 19:04 maxiangelo