How to read predefined (#define) across projects?
<p>I have 2 projects in the same solution: A is static library and B is exe. B depends on A</p>

<p>In B I do a declaration for a DEBUG mode. Something like <code>#define DEBUG</code></p>

<p>Then I went to check if DEBUG is defined in A, if it does then do some debug printing:</p>

<pre><code>// Code in A
#ifdef DEBUG
cout&lt;&lt;"debug message";
#endif
</code></pre>

<p>But this doesn't seem to work. I guess when A is built it doesn't have knowledge about B. How do we go about doing this? Basically because I have different executable project relying on A, and some of them need to print debug messages, and some don't. And yet I don't want to rebuilt A everytime I switch from B to another executable project.</p>
