2012-09-28 92 views
2

当我在Visual Studio 2010上运行我的代码时,得到:Unhandled exception at 0x00b38767 in thesis.exe: 0xC00000FD: Stack overflowCImg错误未处理的异常堆栈溢出

我的代码如下:

#include "CImg.h" 
#define cimg_use_jpg 
using namespace cimg_library; 
int main() { 
CImg<int> image("C:\Users\Echo\Documents\Visual Studio 2010\Projects\thesis\thesissample\thesis\thesis\maze1.jpg"); 
CImgDisplay main_disp(image,"Image",0); 

return 0; 
} 

我一直没能找到任何解释或教程,将让我闯过这一点。我也试过运行一个png文件,但我也遇到了同样的错误。我在64位Windows 7最终版上运行Visual Studio 2010。

+1

我看到用 “CIMG <无符号的字符>”,而不是 “CIMG ” 的教程。不知道这是否有所作为。 http://cimg.sourceforge.net/reference/group__cimg__tutorial.html另外,你的形象有多大?如果您使用“CImg * image = new CImg (...);”。 – Inisheer

+0

我猜'cimg_use_jpg'被头文件'“CImg.h”'使用?在这种情况下,你应该在你包含文件的地方放置'#define',否则头文件将不会看到它。 –

+0

不应该使用正斜杠而不是反斜杠。反斜杠会将角色转换为其他ascii caracter,例如\ t(\ thesis)将变成一个“制表符” - 空格 – Rickard

回答

0

我认为是这样的 的#define cimg_use_jpeg