Visual Studio에 솔루션이 있습니다. 즉 PAL_TEST와 Unit_Test라는 두 가지 프로젝트가 있습니다. 내가 PAL_TEST의 클래스가
, CPALResponse.h오류를 해결할 수 없습니다. LNK2019 : 확인할 수없는 외부 기호
#include "CFW_Stl.h"
class CPALResponse
{
public:
void SetCommandSucceeded(bool bCommandSucceeded = false);
bool GetCommandSucceeded();
void SetCommandType(int nCommandType);
int GetCommandType();
private:
bool m_bCommadSucceeded;
int m_nCommandType;
};
Unit_Test의 파일 Unit_Test.cpp이 있습니다
#include "stdafx.h"
#include "CFW_CPALResponse.h"
void CPALResponse::SetCommandSucceeded(bool bCommandSucceeded)
{
m_bCommadSucceeded = bCommandSucceeded;
}
bool CPALResponse::GetCommandSucceeded()
{
return m_bCommadSucceeded;
}
void CPALResponse::SetCommandType(int nCommandType)
{
m_nCommandType = nCommandType;
}
int CPALResponse::GetCommandType()
{
return m_nCommandType;
}
PAL_TEST CPALResponse.cpp에서 다른 파일,
#include "stdafx.h"
#include "../PAL_TEST/CFW_CPALResponse.h"
int _tmain(int argc, _TCHAR* argv[])
{
CPALResponse a;
a.SetCommandSucceeded(true);
return 0;
}
Unit_Test 프로젝트를 만들면 나를 보여줍니다.
1>------ Build started: Project: Unit_Test, Configuration: Debug Win32 ------
1>Linking...
1>Unit_Test.obj : error LNK2019: unresolved external symbol "public: void __thiscall CPALResponse::SetCommandSucceeded(bool)" ([email protected]@@[email protected]) referenced in function _wmain
1>C:\Users\anubhav.a\Documents\Visual Studio 2008\Projects\PAL_TEST\Debug\Unit_Test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\anubhav.a\Documents\Visual Studio 2008\Projects\PAL_TEST\Unit_Test\Debug\BuildLog.htm"
1>Unit_Test - 2 error(s), 0 warning(s)
는 메시지 및 오류
@EitanT 도움이되지 않음 –
3 개의 파일은 어디에 있습니까? –