0
#include "stdafx.h"
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/png_io.hpp> 
namespace gil = boost::gil;

int _tmain(int argc, _TCHAR* argv[])
{

     gil::gray8_image_t input;
     gil::png_read_image("..\\resources\\frame10.png",input);

     return 0;

}

在主程序中,我想读取 png 图像。调试没有问题。但是当我运行可执行文件时,它崩溃了。什么原因?谢谢!

4

1 回答 1

1

这可能是由于您的相对路径。据我记得,Visual 在 $PROJECT_DIR 中启动调试会话。如果您手动启动 exe(来自 $PROJECT_DIR/Debug(或 Release)),它可能找不到您的资源。

于 2012-01-10T14:06:00.133 回答