在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。
最佳答案
要制作一个独立的应用程序,必须同时禁用“使用动态RTL”和“使用运行时程序包构建”选项。
关于c++ - 当不使用动态RTL进行编译时,我得到EAccessViolation,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8424870/