title: How to undefine a define at commandline using gcc
body: <p>How do I at compile time undefine a compiler macro using gcc. I tried some compile args to gcc like -D but I can't get to see the "not defined" message.</p>
  
  <p>Thanks</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #define MYDEF
  
  
  int main(){
  #ifdef MYDEF
    std::cout&lt;&lt;"defined\n";
  #else
    std::cout&lt;&lt;"not defined\n";
  #endif
  
  }
  </code></pre>