Hi there !
I'm using Code::Blocks since few years and I like it ! But there is an option that I cannot use, and I don't know what is wrong in my use... #defines.
Look : I create a target named "debug", with DEBUG 1 in the #defines tab. Then, I write :
int main()
{
#ifdef DEBUG
cout << "debug" << endl;
#endif
/* ... */
return 0;
}
It should show "debug" in the console, but it doesn't... What's wrong ?
Thank you !
PS : I'm using GNU GCC compiler...
I tried this :
#ifndef ZAFDSGERGEG
cout << "debug" << endl;
#endif
with ZAFDSGERGEG defined....
And it showed "debug" : it shouldn't :x
I really don't understand :?
Okay, here's my real code :
/* debug.h */
#ifdef ZAFDSGERGEG
#include <iostream>
using namespace std;
#define echo(text) cout << text
#else
#define echo(text)
#endif
This code is helpful to show somemore informations when I'm debugging my sources...
And for your questions :
Did you...
- put the define in a wrong target (e..g in the release target but compiled the debug target?!) NO
- forget to re-compile after you had changed the define? NO (maybe yes actually, but I just recompile completely and the problem is still present...)
- set DEBUG=0 somewhere in the code that gets included? NO
It is not the first time I tried to use the defines, but it never worked...