Working version in a separated library
DEBUG sould be defined by the build tool - use make CXXFLAGS=-DDEBUG