读书人

请教这个程序错哪了.

发布时间: 2012-05-22 18:18:54 作者: rapoo

请问这个程序哪里错了...
#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include "disjoint-set.h"
#include <algorithm>
#include <vector>
using namespace System;
using namespace std;
#define width 512
#define height 512
#define cons 300//k
#define THRESHOLD(size, c) (c/size)

struct edgenode
{
int weight;
long int begin,end;
bool operator <(const edgenode& other) const
{
return weight<other.weight;
}
};
vector<edgenode> edge;
int colors[width*height];

int main(array<System::String ^> ^args)
{
edgenode a;
//nodevetex b;
IplImage *pImg,*fImg;
IplImage *newImg;
long int i,j,s,t;

fImg=cvLoadImage("ff.jpg",0);

if(!fImg){
printf("cannot load the file.\n");
return -1;
}

这是程序的一部分。
编译时using namespace System报错,
System:does not exit or is not a namespace


int main(array<System::String ^> ^args) 报错
array:undeclared identifier
System:is not a class or namespace name
String:undeclared identifier
syntax error :'>'


求高手指教。



[解决办法]
你先确定是否有System这个命名空间吧
[解决办法]
+1

探讨
你先确定是否有System这个命名空间吧

[解决办法]
托管C++

探讨

这个好像是C++/CLI,需要打开dot NET支持。

[解决办法]
是不是要给出system空间代码啊?
[解决办法]
去项目属性里,
Configuration Properties->General 页面中
将Common Language Runtime Support设置为Common Language Runtime Support/clr 试试。

读书人网 >C++

热点推荐