boost ptree read_ini使独立应用程序崩溃

时间:2019-03-13 13:55:28

标签: c++ boost codeblocks wxwidgets ptree

我在Windows上将CodeBlocks和wxWidgets与minGW编译器一起使用。在项目的构建选项->搜索目录->编译器下,我有boost根文件夹,在资源编译器wxWidgets-3.1.2 / include文件夹下。

通过CodeBlocks运行应用程序时,程序运行正常,没有错误。但是,当我运行该应用程序的.exe文件(来自project_dir / bin)时,该应用程序在read_ini行(消息框之间)崩溃。

这是我认为相关的代码的一部分:

#include <boost/property_tree/ini_parser.hpp>
boost::property_tree::ptree tree;
int result = FileDialog1->ShowModal();
if (result == wxID_OK)
{
    string f;
    try
    {
        f = string((FileDialog1->GetPath()).mb_str());
        try
        {
            wxMessageBox(_("asdf0 "));
            read_ini(f, tree);
            wxMessageBox(_("asdf1"));
        }
        catch (exception e)
        {
            wxMessageBox(_("Can't read file."));
            return;
        }

我不知道如何解决此问题或从哪里开始。我尝试了一下谷歌搜索,但到目前为止还没有运气。

我将非常感谢您的帮助。让我知道您是否需要更多信息。

0 个答案:

没有答案