<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bedingete Kompilierung]]></title><description><![CDATA[<p>Hallo Gemeinde,</p>
<p>ich würde gerne Log-Meldungen im Debug Modus aus geben, jedoch nicht im Release.</p>
<p>derzeit mache ich das unabhängig von der Kompilierung.</p>
<pre><code class="language-cpp">#define _DEBUG_MODE
#ifdef _DEBUG_MODE
	CLog::getInstance().write(&quot;test&quot;, APP_DEBUG);
#endif
</code></pre>
<p>Kann ich das aber irgendwie von der Kompilierung abhängig? Also was ich brauche ist irgendwie eine Prüfung ob das Programm im Release oder im Debug Modus kompiliert wurde.</p>
<p>Danke.</p>
<p>so long<br />
jd</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/242720/bedingete-kompilierung</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 21:15:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242720.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Jun 2009 14:16:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bedingete Kompilierung on Sun, 07 Jun 2009 14:16:31 GMT]]></title><description><![CDATA[<p>Hallo Gemeinde,</p>
<p>ich würde gerne Log-Meldungen im Debug Modus aus geben, jedoch nicht im Release.</p>
<p>derzeit mache ich das unabhängig von der Kompilierung.</p>
<pre><code class="language-cpp">#define _DEBUG_MODE
#ifdef _DEBUG_MODE
	CLog::getInstance().write(&quot;test&quot;, APP_DEBUG);
#endif
</code></pre>
<p>Kann ich das aber irgendwie von der Kompilierung abhängig? Also was ich brauche ist irgendwie eine Prüfung ob das Programm im Release oder im Debug Modus kompiliert wurde.</p>
<p>Danke.</p>
<p>so long<br />
jd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1722749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1722749</guid><dc:creator><![CDATA[jd]]></dc:creator><pubDate>Sun, 07 Jun 2009 14:16:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingete Kompilierung on Sun, 07 Jun 2009 14:20:38 GMT]]></title><description><![CDATA[<p>Du kannst auf das <code>NDEBUG</code> -Makro prüfen, das im Release-Modus definiert ist. Ich würde dir allerdings raten, das an einer zentralen Stelle zu regeln und nicht ständig Präprozessoranweisungen zwischen den Code platzieren.</p>
<p>Beispiel:</p>
<pre><code class="language-cpp">#ifdef NDEBUG
 #define LOG(TEXT) // im Release-Modus leer definieren
#else
 #define LOG(TEXT) std::clog &lt;&lt; TEXT &lt;&lt; std::endl
#endif
</code></pre>
<p>Es gibt auch noch das <code>_DEBUG</code> -Makro, allerdings ist das nicht standardisiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1722755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1722755</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 07 Jun 2009 14:20:38 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingete Kompilierung on Sun, 07 Jun 2009 15:11:40 GMT]]></title><description><![CDATA[<p>Danke, das funktioniert.</p>
<p>Natürlich wird das an zentraler stelle gemacht.</p>
<p>so long<br />
jd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1722781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1722781</guid><dc:creator><![CDATA[jd]]></dc:creator><pubDate>Sun, 07 Jun 2009 15:11:40 GMT</pubDate></item></channel></rss>