내 코드에서 마지막 오류를 수정하려고합니다. 나는 VS6.0을 VS2008로 마이그레이션했다.Visual Studio 2008 - 오류 C2872 : 'NPC': 모호한 기호
.\SimpleNPC.cpp(216) : error C2872: 'NPC' : ambiguous symbol
could be '.\SimpleNPC.cpp(30) : NPC_Editor::NPC `anonymous-namespace'::NPC'
or 'c:\documents and settings\t411\bureau\serveur\server_rc15g\t4c server\NPC_Editor/NPC.h(27) : NPC_Editor::NPC'
여기에 오류 코드는 다음과 같습니다 :
case InsSendSoldItemList:{
std::list<NPC::SoldItem> itemList;
std::list<NPC::SoldItem>::iterator i;
npc->theNpc->GetSoldItemList(itemList);
CreateItemList
for(i = itemList.begin(); i != itemList.end(); i++){
AddBuyItem((*i).price, Unit::GetIDFromName((*i).itemId.c_str(), U_OBJECT, TRUE))
}
SendBuyItemList
파일의 시작 부분입니다 :
// SimpleNPC.cpp: implementation of the SimpleNPC class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "TFC Server.h"
#include "SimpleNPC.h"
#include "NPCMacroScriptLng.h"
#undef Command
#include "NPC_Editor/NPC.h"
#include "NPC_Editor/Keyword.h"
#include "NPC_Editor/Command.h"
#include "NPC_Editor/IfFlow.h"
#include "NPC_Editor/Assign.h"
#include "NPC_Editor/ForFlow.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
using namespace NPC_Editor;
namespace{
typedef list< Instruction * > InstructionList;
typedef NPC_Editor::NPC NPC;
};
내 마지막 오류 내 SimpleNPC.cpp 파일에
이 파일에서이 코드를 찾을 수 있습니다 :
std::list<NPC_Editor::NPC::SoldItem> soldItems;
충돌이있는 이유를 알고 있습니까? 감사합니다.
"헤더 파일은 ..."이라고 작성했지만 .cpp 파일 내용을 붙여 넣었습니다. 관련 콘텐츠를 .cpp와 .h로 모두 붙여 넣으십시오. –
예 죄송합니다. 나쁜 번역입니다. 다음과 같이 말하고 싶습니다. 파일의 맨 위에 있습니다. –