我说要使用QTcreator,而对于我的应用程序,我必须使用CImg.h来播放'有些图像,但是当我尝试加载某些图像时会出现此错误:
"[CImg] *** CImgIOException *** [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load(): Failed to open file 'image.jpg'.
terminate called after throwing an instance of 'cimg_library::CImgIOException'
what(): [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load(): Failed to open file 'image.jpg' "
void MainWindow::on_pushButton_4_clicked()
{
cimg_library::CImg<unsigned char> img01("image.jpg");
img01.display("image");
}
我已经安装了ImageMagick但没有解决。有人可以帮我吗?
(我使用最新版本的Fedora。)
答案 0 :(得分:1)
按照@FrankOsterfeld的提示我刚刚使用了完整路径并打开了图像!伙计们!