智能感知和CImg库问题,Win7 64位VS2008 [英] Problem with intellisense and CImg library, Win7 64-bit VS2008

查看:105
本文介绍了智能感知和CImg库问题,Win7 64位VS2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,这可能很容易修复,因为我相对缺乏经验,但我无法通过谷歌或其他任何方式在论坛中找到任何解决方案。


<因此,我正在尝试使用CImg库,并且intellisense不适用于任何CImg类。我已经将CImg.h添加到解决方案中(CImg.h与main函数的.cpp文件位于同一个文件夹中),即使我复制并粘贴了非常简单的示例,例如这里找到的
(< a href ="http://cimg.sourceforge.net/reference/group__cimg__tutorial.html"> http://cimg.sourceforge.net/reference/group__cimg__tutorial.html ),intellisense不起作用。


此外,当我编译时,我通过abort,retry或ignore选项得到以下调试错误:


"此应用程序已请求运行时以不寻常的方式终止它。有关详细信息,请与应用程序的支持团队联系。"


 


在命令行中,我得到以下输出:


无效参数 - " C:\ Users \Kevin \ AppData \ Local \ Temp \ xju5HLyG.pnm"


'gm .exe'不被识别为内部或外部命令,


可操作程序或批处理文件。


无效参数 - " C:\ Users \Kevin\AppData \ Local \Temp \ 0bSNAR5f.pnm"


'gm.exe'无法识别为内部或外部命令,


可操作程序或批处理文件。


无效参数 - " C:\ Users \Kevin \ AppData \ Local \ Temp \HC8vbH01.pnm" ;


'gm.exe'无法识别为内部或外部命令,


可操作程序或批处理文件。


 


另一个例子,pg。本pdf的第3篇http://www.math.ucla.edu/~wittman/hyper/vick/Cimg_tutorial.pdf,将无法编译。我不怀疑这可能源于同样的问题。以下是与我复制的完全相同的代码:


 


#include" CImg.h"


使用命名空间cimg_libary;


int main(){


CImg< double> image(" starwars.bmp");


CImgDisplay main_disp(image," Image",0);


CImg< double> darkimage(image.dimx(),image.dimy(),1,3,0);


 


for(int i = 0; i< image.dimx(); i ++)


for(int j = 0; j< image.dimy(); j ++)


for(int k = 0; k <3; k ++)


darkimage(i,j,0,k)= image(i,j,0,k)/ 2;


 


CImgDisplay dark_disp(darkimage,"Dark Image",0);


while( !main_disp.is_closed())


main_disp.wait();


返回0;


}


 


以下是错误:


 


main.cpp(2):错误C2871:'cimg_libary':具有此名称的命名空间不存在


main.cpp(11):错误C2065:'CImg' :未声明的标识符


main.cpp(11):错误C2062:输入'double'意外


main.cpp(12):错误C2065: 'CImgDisplay':未声明的标识符


main.cpp(12):错误C2146:语法错误:在标识符'main_disp'之前缺少';'


main.cpp(12):错误C2065:'image' :未声明的标识符


main.cpp(12):错误C3861:'main_disp':未找到标识符


main.cpp(13):错误C2065:'CImg':未声明的标识符


main.cpp(13):错误C2062:输入'double'意外


main.cpp(15) ):错误C2065:'image':未声明标识符


main.cpp(15):错误C2228:'。dimx'左边必须有class / struct / union,type是'' unknown-type''


main.cpp(16):错误C2065:'image':未声明的标识符


main.cpp(16):错误C2228:'。dimy'左边必须有class / struct / union,type是''unknown-type''


main.cpp(18):错误C3861:'darkimage' :找不到标识符


main.cpp(18):错误C3861:'image':找不到标识符


main.cpp(20):错误C2065:'CImgDisplay':未声明的标识符


main.cpp(20):错误C2146:语法错误:在标识符'dark_disp'之前缺少';'


主.cpp(20):错误C2065:'darkimage':未声明的标识符


main.cpp(20):错误C3861:'dark_disp':找不到标识符


main.cpp(21):错误C2065:'main_disp':未声明的标识符


main.cpp(21):错误C2228:'。is_closed'的左边必须有类/ struct / union,type是''unknown-type''


main.cpp(21):致命错误C1903:无法从之前的错误中恢复;停止编译


 


 


我写了一个任意的结构来检查intellisense是否只是没有使用CImg的东西,它确实与结构一起工作,所以我假设我做错了或不做我需要做的事情,以便适当地包括CImg标题。
最令人讨厌的是,我认识的这个研究生给我发了一个他正在研究的项目,它也使用了CImg库,而intellisense在他的项目中也适用了它,但是我试着去搜索他的包括和宏和项目设置
试图找出他做的不同,我做不到。所以,是的,它可能是愚蠢的东西,但我已经厌倦了,所以任何帮助都会非常感激!


另外,如果您认为这属于其他论坛,请允许我知道,我会移动它。


谢谢,


-Kevin


 

解决方案

更新:


我今天开始了一个新项目,intellisense正在与CImg库合作几个小时,然后它突然停止工作。我认为我的VS08安装有问题。有没有人有类似的事情发生或听到过?


Hey, this is probably really simple to fix since I'm relatively inexperienced, but I just cannot manage to find any solutions in the forums, through google, or anything.

So I'm trying to use the CImg library and intellisense isn't working for any of the CImg classes. I've added CImg.h to the solution (CImg.h is in the same folder as the main function's .cpp file) and even if I copy and paste really simple examples, such as the one found here (http://cimg.sourceforge.net/reference/group__cimg__tutorial.html), intellisense doesn't work.

Furthermore, when I compile, I get the following debug error with the abort, retry, or ignore options:

"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

 

And in the command line, I get the following ouput:

Invalid Parameter - "C:\Users\Kevin\AppData\Local\Temp\xju5HLyG.pnm"

'gm.exe' is not recognized as an internal or external command,

operable program or batch file.

Invalid Parameter - "C:\Users\Kevin\AppData\Local\Temp\0bSNAR5f.pnm"

'gm.exe' is not recognized as an internal or external command,

operable program or batch file.

Invalid Parameter - "C:\Users\Kevin\AppData\Local\Temp\HC8vbH01.pnm"

'gm.exe' is not recognized as an internal or external command,

operable program or batch file.

 

Another example, pg. 3 of this pdf http://www.math.ucla.edu/~wittman/hyper/vick/Cimg_tutorial.pdf, won't compile. I don't doubt that this may be stemming from the same problem. Here's the code exactly as I have copied it:

 

#include "CImg.h"

using namespace cimg_libary;

int main(){

CImg<double> image("starwars.bmp");

CImgDisplay main_disp(image,"Image",0);

CImg<double> darkimage(image.dimx(),image.dimy(),1,3,0);

 

for(int i=0;i<image.dimx();i++)

for(int j=0;j<image.dimy();j++)

for(int k=0;k<3;k++)

darkimage(i,j,0,k) = image(i,j,0,k)/2;

 

CImgDisplay dark_disp(darkimage,"Dark Image",0);

while(!main_disp.is_closed())

main_disp.wait();

return 0;

}

 

And here are the errors:

 

main.cpp(2) : error C2871: 'cimg_libary' : a namespace with this name does not exist

main.cpp(11) : error C2065: 'CImg' : undeclared identifier

main.cpp(11) : error C2062: type 'double' unexpected

main.cpp(12) : error C2065: 'CImgDisplay' : undeclared identifier

main.cpp(12) : error C2146: syntax error : missing ';' before identifier 'main_disp'

main.cpp(12) : error C2065: 'image' : undeclared identifier

main.cpp(12) : error C3861: 'main_disp': identifier not found

main.cpp(13) : error C2065: 'CImg' : undeclared identifier

main.cpp(13) : error C2062: type 'double' unexpected

main.cpp(15) : error C2065: 'image' : undeclared identifier

main.cpp(15) : error C2228: left of '.dimx' must have class/struct/union, type is ''unknown-type''

main.cpp(16) : error C2065: 'image' : undeclared identifier

main.cpp(16) : error C2228: left of '.dimy' must have class/struct/union, type is ''unknown-type''

main.cpp(18) : error C3861: 'darkimage': identifier not found

main.cpp(18) : error C3861: 'image': identifier not found

main.cpp(20) : error C2065: 'CImgDisplay' : undeclared identifier

main.cpp(20) : error C2146: syntax error : missing ';' before identifier 'dark_disp'

main.cpp(20) : error C2065: 'darkimage' : undeclared identifier

main.cpp(20) : error C3861: 'dark_disp': identifier not found

main.cpp(21) : error C2065: 'main_disp' : undeclared identifier

main.cpp(21) : error C2228: left of '.is_closed' must have class/struct/union, type is ''unknown-type''

main.cpp(21) : fatal error C1903: unable to recover from previous error(s); stopping compilation

 

 

I wrote an arbitrary struct to check if intellisense was only not working with the CImg stuff and it did work with the struct, so I'm assuming I'm doing something wrong or not doing something I need to do in order to include the CImg header appropriately. The most annoying thing is that this grad student I knew sent me a project he was working on to look at and it uses the CImg library as well and the intellisense works for it in his project, but I tried scouring his includes and macros and project settings to try to figure out what he did differently, and I couldn't. So, yeah, it's probably something dumb, but I'm so tired of it so any help would be greatly appreciated!

Also, if you think this belongs in a different forum, let me know and I'll move it.

Thanks,

-Kevin

 

解决方案

Update:

I started a new project today and intellisense was working with CImg library for a few hours and then it just suddenly stopped working. I think something is wrong with my installation of VS08. Anyone ever have something similar happen or hear of it?


这篇关于智能感知和CImg库问题,Win7 64位VS2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆