问题描述
大家好,
我用C ++做一些图像处理工作.为此,我使用CImg.h库,觉得对我的工作很有帮助.
这是我写的一小段代码,它们只读取并显示图像.
hi all,
I do some image processing work in C++. For this i use CImg.h library which i feel is good for my work.
Here is small piece of code written by me which just reads an image and displays it.
#include "../CImg.h"
using namespace cimg_library;
int main(int argc,char**argv)
{
CImg img(argv[1]);
img.display();
return 0;
}
当我输入lena.pgm作为此代码时,它可以正常工作并显示图像.好像我给出了其他图像,例如存在于同一工作目录中的ddnl.pgm一样,我得到分割错误".
当我使用gdb运行代码时,我得到的输出如下:
程序收到信号SIGSEGV,分段错误. /lib/libc.so.6中strlen()中的0x009823a3缺少单独的debuginfo,请使用:debuginfo-install glibc-2.9-2.i686 libX11-1.1.4-5.fc10.i386 libXau-1.0.4-1.fc10 .i386 libXdmcp-1.0.2-6.fc10.i386 libgcc-4.3.2-7.i386 libstdc ++-4.3.2-7.i386 libxcb-1.1.91-5.fc10.i386
有人可以告诉我问题是什么吗?以及解决方法.
谢谢大家
When i give lena.pgm as input this code it works fine and displays the image. Where as if i give some other image, for example ddnl.pgm which is present in the same working directory i get "Segmentation Fault".
When i ran the code using gdb i get the output as follows:
Program received signal SIGSEGV, Segmentation fault. 0x009823a3 in strlen () from /lib/libc.so.6 Missing separate debuginfos, use: debuginfo-install glibc-2.9-2.i686 libX11-1.1.4-5.fc10.i386 libXau-1.0.4-1.fc10.i386 libXdmcp-1.0.2-6.fc10.i386 libgcc-4.3.2-7.i386 libstdc++-4.3.2-7.i386 libxcb-1.1.91-5.fc10.i386
Can some one please tell me what the problem is? and how to solve it.
Thank you all
推荐答案
这篇关于该程序的分段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!