For conditional compiling the code must look something like this:
#include <iostream>
using namespace std;
int main (){
#ifdef Somedef
int fd = 0;
cout<<fd;
#else
int dd =0;
cout<<dd;
#endif
system("pause");
return 0;
}
And then while compiling the code give command line argument for the define for eg: gcc -DSomedef test.c -o test to include the code and remove the command line define for removing the code
Note: You have checked "#if true" for conditional compiling that statement will always be true and hence will include that part of the code while compiling.