请问这个程序哪里错了...

ly08n23 2012-04-09 03:26:20
#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 :'>'


求高手指教。

...全文
143 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly08n23 2012-04-10
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 的回复:]

去项目属性里,
Configuration Properties->General 页面中
将Common Language Runtime Support设置为Common Language Runtime Support/clr 试试。
[/Quote]


显示

1>cl: 命令行 error D8016 :“/MTd”和“/clr”命令行选项不兼容
1>项目 : error PRJ0002 : 错误的结果 2 (从“D:\Microsoft Visual Studio 9.0\VC\bin\cl.exe”返回)。

这是什么意思呀。。。
loongee 2012-04-10
  • 打赏
  • 举报
回复
去项目属性里,
Configuration Properties->General 页面中
将Common Language Runtime Support设置为Common Language Runtime Support/clr 试试。
ly08n23 2012-04-10
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

托管C++

引用 1 楼 的回复:

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



请问怎么托管呀。。
ly08n23 2012-04-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

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


是在新建项目的时候选嘛?我用的VS2008.. 新建项目时选的WIN32控制台程序..
AndyZhang 2012-04-09
  • 打赏
  • 举报
回复
是不是要给出system空间代码啊?
loongee 2012-04-09
  • 打赏
  • 举报
回复
托管C++

[Quote=引用 1 楼 的回复:]

这个好像是C++/CLI,需要打开dot NET支持。
[/Quote]
疯疯癫癫 2012-04-09
  • 打赏
  • 举报
回复
+1
[Quote=引用 2 楼 的回复:]
你先确定是否有System这个命名空间吧
[/Quote]
pengzhixi 2012-04-09
  • 打赏
  • 举报
回复
你先确定是否有System这个命名空间吧
Jim_King_2000 2012-04-09
  • 打赏
  • 举报
回复
这个好像是C++/CLI,需要打开dot NET支持。

64,642

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧