CTK icon indicating copy to clipboard operation
CTK copied to clipboard

DEBUG variable in ctkServiceTracker_p et.al

Open khlebnikov opened this issue 9 years ago • 4 comments

Dear CTK developers,

I have noticed that building CTK-dependent applications fails when building debug configuration. The reason for this turned out to be that there is a variable named DEBUG in ctkServiceTracker_p and several other files. Some library (I'm not even sure which) defines this macro in debug build which leads to compiler error as '''static const bool DEBUG; // = false;''' is changed by the preprocessor to simply '''static const bool ; // = false;'''

I think renaming the variable would make sense to fix this issue.

Platform: win7/8, msvc2013.

Rostislav.

khlebnikov avatar May 20 '15 15:05 khlebnikov

@khlebnikov Thanks for reporting the problem.

@saschazelzer What do you think ?

jcfr avatar Jun 01 '15 14:06 jcfr

I think windows.h and macros are great. Seriously, I would happily merge any PR that changes DEBUGto e.g. DEBUG_TRACKERor some other sane identifier.

saschazelzer avatar Jun 01 '15 17:06 saschazelzer

Hi, it's been a long delay for such a fix - but here's a pull request: https://github.com/commontk/CTK/pull/583

I've changed it to DEBUG_FLAG for simplicity as it's not always tracker... Tested in VS2013 by building CTKPluginBrowser app (BUILD_TESTING also set to ON).

rkhlebnikov avatar Jul 21 '15 15:07 rkhlebnikov

:+1:

jcfr avatar Jul 21 '15 15:07 jcfr