控制台程序使用出错,怎么解决?

brk1985 brk1985 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区


#include<iostream>
#include <Afxtempl.h>

using namespace std;


class Car{
public:
void setLen(int len){
c_lenth = len;
}
void setWid(int wid){
c_width = wid;
}
int getLen(){
return c_lenth;
}
int getWid(){
return c_width;
}
private:
int c_lenth;
int c_width;
};

void main()
{
int i=10;
cout << i;

}


为什么include<Afxtempl.h>,cout语句就无法使用?如何解决?

错误信息:
1>nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) 已经在 libcpmt.lib(newaop.obj) 中定义
1>E:\运动目标分类\目标分类代码版本\毕业设计实验\test\Debug\test.exe : fatal error LNK1169: 找到一个或多个多重定义的符号
...全文
评论 1
收藏 已收藏
分享
返回顶部
brk1985
C++ 语言 65,214 成员 250,514 内容