关于类的重命名问题

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

//MyProcess.h
#pragma once
namespace Process
{
HTREEITEM m_hRoot;
void addRoot(char* szBuffer, CTreeCtrl& mtree);
class CMyProcess
{
public:
CMyProcess(void);
~CMyProcess(void);
};
}

//MyProcess.cpp
void Process::addRoot(char* str, CTreeCtrl& mtree)
{
CString s(str);
mtree.DeleteAllItems();
m_hRoot = mtree.InsertItem(GetValue(s,L"deptName"));
}

在StdAfx.h中
#include "MyProcess.h"
using namespace Process;



1>stdafx.obj : error LNK2005: "struct _TREEITEM * Process::m_hRoot" (?m_hRoot@Process@@3PAU_TREEITEM@@A) 已经在 MyProcess.obj 中定义
1>C:\VC\VS9\iMsnDlg\Debug\iMsnDlg.dll : fatal error LNK1169: 找到一个或多个多重定义的符号


编译过程中出现以上错误
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
rundll64
VC/MFC 16,550 成员 421,606 内容