在没有动态RTL的情况下进行编译时,我得到EAccessViolation

时间:2011-12-08 01:01:23

标签: c++ c++builder

在Borland C ++ Builder 6中,当我尝试通过取消选中“使用动态RTL”创建独立应用程序时,我获得了EAccessViolation。 MWE是:

#include <vcl.h>
pragma hdrstop
#include "fstream.h"
#include "Unit1.h"
pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
ifstream pies;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{}

其中我只有一个带有

的空白项目
ifstream pies;

加入了它。

它在_STLP_IOS_C中出现故障: 在

template <class _CharT, class _Traits>
basic_ios<_CharT, _Traits>::basic_ios()
  : ios_base(),
    _M_fill(_STLP_NULL_CHAR_INIT(_CharT)), _M_streambuf(0), _M_tied_ostream(0)
{}

指向

      : ios_base(),

我该如何解决这个问题?我需要一个可以移动到其他地方的应用程序,但我也需要fstream。

1 个答案:

答案 0 :(得分:2)

要创建一个独立的应用程序,您必须同时禁用“使用动态RTL”和“使用运行时包构建”选项。