<?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[Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation]]></title><description><![CDATA[<p>Hallo,<br />
habe ein Problem beim laufen einer Application wenn sie ohne &quot;dynamic RTL&quot; gebuildet wurde. Hoffe, die englische Beschreibung stoert nicht - wenn doch, kann ichs gerne nochmal in deutsch tippseln <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>I have a BCB6 project which runs fine in the debug environment / on the development pc (WinXP).<br />
But what I want is to compile a standalone .exe which runs on its own without any additional files (components, dll, ..).<br />
For this, as I understand, the following options in the project settings have to be untagged:<br />
- Packages - Build with runtime packages<br />
- Linker - Use dynamic RTL</p>
<p>As soon as I untag the &quot;use dynamic RTL&quot; the following error message shows up when I run the program:<br />
&quot;Access violation at address xxxxxxx. Read of address 00000000.&quot;</p>
<p>By debugging into the project, I could gather the following informtation:<br />
This happens BEFORE the main fuction is called. (placing breakpoint at beginning of main, looking at callStack).<br />
When debugging, the execution stopps in ../cbuilder6/include/stl/_ios.c at the basic_ios template, which is not my code.<br />
The callStack lists Log::Log, which is in my code (code and callstack see below).<br />
It is possible to place a breakpoint in the line marked with &quot;#1&quot; but will not reach &quot;#2&quot; - the problem happens before.</p>
<p>I have already tried to remove global variables from class files (found this to be the possible cause by research).<br />
This did not change anything.<br />
There are, however, files with global functions in the project.</p>
<p>I am new to BCB and would very much appreciate your help.<br />
myme</p>
<blockquote>
<p>//*********************************************<br />
//*********************************** CALLSTACK<br />
//*********************************************</p>
<p>7C812A5B C:\WINNT\system32\kernel32.dll<br />
004E970B ___raiseDebuggerException<br />
004E2100 ___DefHandler<br />
7C9037BF ntdll.dll<br />
7C90378B ntdll.dll<br />
7C90EAFA ntdll.dll<br />
004EE7E3 _STL::ios_base::ios_base<br />
0042D092 _STL::basic_ios&lt;char, _STL::char_traits&lt;char&gt; &gt;::basic_ios&lt;char, _STL::char_traits&lt;char&gt; &gt;(this=:0052156C)<br />
0042C994 _STL::basic_ofstream&lt;char, _STL::char_traits&lt;char&gt; &gt;::basic_ofstream&lt;char, _STL::char_traits&lt;char&gt; &gt;(this=:005214BC)<br />
0042C8B0 Log::Log(this=:005214B4)<br />
004168BD _STCON0_()<br />
004E813D __init_exit_proc<br />
004E8313 __startup</p>
</blockquote>
<pre><code>//*********************************************
//************************************* log.cpp
//*********************************************
#include &quot;log.h&quot;
#include &lt;string&gt;

Log::Log()
{                        [b]//Breakpoint #1 - stopps here[/b]
  msg_counter=0;         [b]//Breakpoint #2 - does not get here[/b]
  num_of_msg=0;
  MAX_NUM_OF_MSG=10;
  messages= new string[MAX_NUM_OF_MSG];
  has_changed_since_last_read=false;
  changes_since_last_read=0;
  has_file=false;
}
.....
</code></pre>
<pre><code>//*********************************************
//************************************** _ios.c
//*********************************************
....
// Protected constructor and initialization functions. The default
// constructor creates an uninitialized basic_ios, and init() initializes
// all of the members to the values in Table 89 of the C++ standard.

template &lt;class _CharT, class _Traits&gt;
basic_ios&lt;_CharT, _Traits&gt;::basic_ios()
  : ios_base(),                             [b]//stopps here (arrow)[/b]
    _M_fill(_STLP_NULL_CHAR_INIT(_CharT)), _M_streambuf(0), _M_tied_ostream(0)
{}
....
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/163853/build-ohne-quot-dynamic-rtl-quot-produziert-access-violation</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 11:35:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163853.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Nov 2006 14:16:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 14:16:12 GMT]]></title><description><![CDATA[<p>Hallo,<br />
habe ein Problem beim laufen einer Application wenn sie ohne &quot;dynamic RTL&quot; gebuildet wurde. Hoffe, die englische Beschreibung stoert nicht - wenn doch, kann ichs gerne nochmal in deutsch tippseln <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>I have a BCB6 project which runs fine in the debug environment / on the development pc (WinXP).<br />
But what I want is to compile a standalone .exe which runs on its own without any additional files (components, dll, ..).<br />
For this, as I understand, the following options in the project settings have to be untagged:<br />
- Packages - Build with runtime packages<br />
- Linker - Use dynamic RTL</p>
<p>As soon as I untag the &quot;use dynamic RTL&quot; the following error message shows up when I run the program:<br />
&quot;Access violation at address xxxxxxx. Read of address 00000000.&quot;</p>
<p>By debugging into the project, I could gather the following informtation:<br />
This happens BEFORE the main fuction is called. (placing breakpoint at beginning of main, looking at callStack).<br />
When debugging, the execution stopps in ../cbuilder6/include/stl/_ios.c at the basic_ios template, which is not my code.<br />
The callStack lists Log::Log, which is in my code (code and callstack see below).<br />
It is possible to place a breakpoint in the line marked with &quot;#1&quot; but will not reach &quot;#2&quot; - the problem happens before.</p>
<p>I have already tried to remove global variables from class files (found this to be the possible cause by research).<br />
This did not change anything.<br />
There are, however, files with global functions in the project.</p>
<p>I am new to BCB and would very much appreciate your help.<br />
myme</p>
<blockquote>
<p>//*********************************************<br />
//*********************************** CALLSTACK<br />
//*********************************************</p>
<p>7C812A5B C:\WINNT\system32\kernel32.dll<br />
004E970B ___raiseDebuggerException<br />
004E2100 ___DefHandler<br />
7C9037BF ntdll.dll<br />
7C90378B ntdll.dll<br />
7C90EAFA ntdll.dll<br />
004EE7E3 _STL::ios_base::ios_base<br />
0042D092 _STL::basic_ios&lt;char, _STL::char_traits&lt;char&gt; &gt;::basic_ios&lt;char, _STL::char_traits&lt;char&gt; &gt;(this=:0052156C)<br />
0042C994 _STL::basic_ofstream&lt;char, _STL::char_traits&lt;char&gt; &gt;::basic_ofstream&lt;char, _STL::char_traits&lt;char&gt; &gt;(this=:005214BC)<br />
0042C8B0 Log::Log(this=:005214B4)<br />
004168BD _STCON0_()<br />
004E813D __init_exit_proc<br />
004E8313 __startup</p>
</blockquote>
<pre><code>//*********************************************
//************************************* log.cpp
//*********************************************
#include &quot;log.h&quot;
#include &lt;string&gt;

Log::Log()
{                        [b]//Breakpoint #1 - stopps here[/b]
  msg_counter=0;         [b]//Breakpoint #2 - does not get here[/b]
  num_of_msg=0;
  MAX_NUM_OF_MSG=10;
  messages= new string[MAX_NUM_OF_MSG];
  has_changed_since_last_read=false;
  changes_since_last_read=0;
  has_file=false;
}
.....
</code></pre>
<pre><code>//*********************************************
//************************************** _ios.c
//*********************************************
....
// Protected constructor and initialization functions. The default
// constructor creates an uninitialized basic_ios, and init() initializes
// all of the members to the values in Table 89 of the C++ standard.

template &lt;class _CharT, class _Traits&gt;
basic_ios&lt;_CharT, _Traits&gt;::basic_ios()
  : ios_base(),                             [b]//stopps here (arrow)[/b]
    _M_fill(_STLP_NULL_CHAR_INIT(_CharT)), _M_streambuf(0), _M_tied_ostream(0)
{}
....
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1167016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167016</guid><dc:creator><![CDATA[myme]]></dc:creator><pubDate>Thu, 02 Nov 2006 14:16:12 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 14:33:43 GMT]]></title><description><![CDATA[<p>Hi,</p>
<blockquote>
<p>&quot;Access violation at address xxxxxxx. Read of address 00000000.&quot;</p>
</blockquote>
<p>zeigt den Leseversuch in einem nicht initialisierten Speicherbereich.<br />
Liegt normalerweise an einem nicht initialisierten Pointer (evtl. Klasseninstanz nicht gebildet?).<br />
Es ist nicht anzunehmen, das std:io in diesem Bereich einen Fehler hat,<br />
normalerweise verwirrst du den Debugger, indem du ihn mit einem solchen Pointer arbeiten lässt.</p>
<p>Das es im Debugmode läuft (mit RTL), aber nicht ohne, ist etwas, das ich auch schon kennen lernen durfte.<br />
Es liegt wahrscheinlich daran, das der Arbeitsspeicher anders organisiert wird, der Fehler mit dem nicht initialisierten Zeiger ist dann (manchmal) nicht sofort offensichtlich.<br />
Hast du einmal Codeguard eingeschaltet?</p>
<p>&lt;edit: sch... Fremdwörter&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167029</guid><dc:creator><![CDATA[SilentSurfer]]></dc:creator><pubDate>Thu, 02 Nov 2006 14:33:43 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 14:44:26 GMT]]></title><description><![CDATA[<p>Hi SilentSurfer,<br />
danke für den Hinweis mit Codeguard - hatte ihn nicht eingeschaltet.<br />
Werd mich mal mit Codeguard beschaeftigen und schaun was sich rausfinden laesst. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167051</guid><dc:creator><![CDATA[myme]]></dc:creator><pubDate>Thu, 02 Nov 2006 14:44:26 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 16:16:17 GMT]]></title><description><![CDATA[<p>Hab mir Codeguard angesehen und ihn eingeschaltet.<br />
Leider tritt der Fehler schon auf bevor Codeguard etwas findet.</p>
<p>Mit verwendeten RTL (Programm lauft laenger) werden Fehler im Code gefunden ..<br />
allerdings auch erst zu einem spaeteren Zeitpunkt<br />
(sobald Buttons gedrueckt werden, etc..).</p>
<p>So wie ich das verstanden habe, muesste Codeguard nicht initialiserte Pointer finden?<br />
Wie kann sich ein nicht initialisierter Pointer zum Zeitpunkt des Programmstartes<br />
VOR aufruf der Main() bereits auswirken?</p>
<p>..hm.. wie gehe ich jetzt am besten vor um herauszufinden, was nicht stimmt? *gruebelgruebel*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167120</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167120</guid><dc:creator><![CDATA[myme]]></dc:creator><pubDate>Thu, 02 Nov 2006 16:16:17 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 16:35:10 GMT]]></title><description><![CDATA[<p>Hi,<br />
Grundsätzlich kann die Codeguard auch nur Fehler anzeigen, wenn er gestartet ist.<br />
Dein Fehler scheint schon beim erstellen einiger Objekte aufzutreten.</p>
<p>Leider habe ich nicht viel von deinem Quellcode gesehen, aber lass mich mal ein bisschen raten:<br />
Es sieht aus, als ob der Fehler in einer Log Klasse entsteht, die du geschrieben hast.<br />
Ein Objekt dieser Logklasse erstellst du bestimmt. (im Konstruktor der Form?)</p>
<p>Greift vielleicht eine andere Klasse die du erstellst auf eine Logfunktion zu, bevor es ein Objekt der Log Klasse gibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167130</guid><dc:creator><![CDATA[SilentSurfer]]></dc:creator><pubDate>Thu, 02 Nov 2006 16:35:10 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 16:37:58 GMT]]></title><description><![CDATA[<p>Noch als Tip:<br />
Vor Main werden einige Objekte gebildet,<br />
also mal in den Konstruktoren deiner Klassen nachschauen, was da so passiert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167132</guid><dc:creator><![CDATA[SilentSurfer]]></dc:creator><pubDate>Thu, 02 Nov 2006 16:37:58 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 02 Nov 2006 17:30:06 GMT]]></title><description><![CDATA[<p>Danke, ich werde das überprüfen..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167159</guid><dc:creator><![CDATA[myme]]></dc:creator><pubDate>Thu, 02 Nov 2006 17:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Sat, 18 Nov 2006 02:04:13 GMT]]></title><description><![CDATA[<p>hm... hatte bis eben das Gleiche Problem und hab ewig gesucht.</p>
<p>Er ist mir abgeschmiert, wenn ein globaler ofstream im Programm ist oder in einer Klasse, würde ich mal kontrollieren, wenn Problem nicht schon erledigt.<br />
Finde ich jetzt zwar seltsam, aber naja.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1176442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1176442</guid><dc:creator><![CDATA[dreaddy]]></dc:creator><pubDate>Sat, 18 Nov 2006 02:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Thu, 08 Feb 2007 20:33:00 GMT]]></title><description><![CDATA[<p>dreaddy schrieb:</p>
<blockquote>
<p>hm... hatte bis eben das Gleiche Problem und hab ewig gesucht.</p>
<p>Er ist mir abgeschmiert, wenn ein globaler ofstream im Programm ist oder in einer Klasse, würde ich mal kontrollieren, wenn Problem nicht schon erledigt.<br />
Finde ich jetzt zwar seltsam, aber naja.</p>
</blockquote>
<p>Ich kann nich so gut Deutsch scheiben, darum schreibe ich auf Englisch:<br />
I had the same problem as the topic-starter. When I removed 'dynamic RTL' from the linker options I got a access-violation at address 0, but when compiling with dynamic RTL there was no problem.<br />
I had a global ofstream for debugging, I removed it and now my program works again. Thanks for you help.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1225334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1225334</guid><dc:creator><![CDATA[tedades (not logged in)]]></dc:creator><pubDate>Thu, 08 Feb 2007 20:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to Build ohne &amp;quot;dynamic RTL&amp;quot; produziert Access violation on Fri, 09 Feb 2007 08:56:56 GMT]]></title><description><![CDATA[<p>Das Problem tritt bei mir dann auf, wenn ich Projekt habe, welches mehrere Libs mit einbindet und die in unterschiedlichen Modi compiliert worden sind (mit und ohne dynamisch RTL). Wichtig ist hier, dass alle im Projekt verwendeteten Bibliotheken die gleichen Einstellungen nutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1225492</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1225492</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 09 Feb 2007 08:56:56 GMT</pubDate></item></channel></rss>