请教这个程序错哪了.
请问这个程序哪里错了...
#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
------解决方案--------------------
托管C++
------解决方案--------------------
是不是要给出system空间代码啊?
------解决方案--------------------
去项目属性里,
Configuration Properties->General 页面中
将Common Language Runtime Support设置为Common Language Runtime Support/clr 试试。
#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
------解决方案--------------------
托管C++
------解决方案--------------------
是不是要给出system空间代码啊?
------解决方案--------------------
去项目属性里,
Configuration Properties->General 页面中
将Common Language Runtime Support设置为Common Language Runtime Support/clr 试试。