2012-07-11 5 views
0

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) 

는 메시지 및 오류

+0

@EitanT 도움이되지 않음 –

+0

3 개의 파일은 어디에 있습니까? –

답변

0

여기에 일반적인 체크리스트의를 해결하는 방법, 문제는 이들 중 하나입니다 무엇을 의미하는지 나에게 명확하지 않다 :

  • 당신이 가진 클래스를 수출하지 않는 declspec(dllexport)도 호출 프로젝트에서 declspec(dllimport)으로 가져 오지 마십시오.

  • 구현을 사용하여 파일을 컴파일해야합니다.

  • 클래스를 사용하는 프로젝트가 첫 번째 프로젝트에서 생성 된 .lib에 연결되는지 확인하십시오.

+0

죄송합니다. 저는 Visual Studio를 사용하거나 Windows 라이브러리를 만드는 데 초보자입니다. 더 자세히 설명 할 수 없다면 도움이 될 것입니다. –

+0

@AnubhavAgarwal이 용어 중 하나를 Google에서 검색하면 도움이 될 것입니다. 모든 것을 자세하게 설명해야합니다. –

관련 문제