c++ - boost ptree read_ini 使独立应用程序崩溃
问题描述
我在 Windows 上使用带有 minGW 编译器的 CodeBlocks 和 wxWidgets。在项目的构建选项->搜索目录->编译器下,我有 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;
}
我不知道如何解决这个问题或从哪里开始。我试着用谷歌搜索了一下,但到目前为止还没有运气。
我将非常感谢任何帮助。如果您需要更多信息,请告诉我。
解决方案
推荐阅读
- javascript - CSS 转换未按预期触发
- python - 弹丸不会变成图像错误如何修复?
- garbage-collection - 在 valgrind 和 jvm 中测量经过的时间
- javascript - javascript this 在方法中未定义
- java - 如何将具有一对一关系 pojo(ROOM 实现)与 safeArgs 的 List<> 传递到目的地
- git - GitAhead:意外的 HTTP 状态代码:404
- java - 如何让按钮适应 Android Studio 中的任何屏幕尺寸
- python - 在 Windows 10 x64 上从命令行运行 GDAL
- html - 将不透明度添加到行的背景颜色
- python - Python Pandas DataFrame - 数据由索引而不是行显示