【发布时间】:2017-03-21 10:53:00
【问题描述】:
这是我的课
namespace AuthenticationAdapter
{
class OPENID_EXPORT_API AuthenticationHelper
{
public:
static CString isOpenIdAuthentication( CString hostUrl, bool &isOpenId );
static CString Authenticate( CString hostUrl, CString& tokenId);
};
};
这是 openidExport.h
#ifndef OPENIDEXPORT_H
#define OPENIDEXPORT_H
#ifdef OPENID_EXPORT
#define OPENID_EXPORT_API __declspec(dllexport)
#else
#define OPENID_EXPORT_API __declspec(dllimport)
#endif
#endif
这是实现
namespace AuthenticationAdapter
{
CString AuthenticationHelper::isOpenIdAuthentication( CString hostUrl,bool &isOpenId )
{
...
}
}
这是电话
CString error = AuthenticationAdapter::AuthenticationHelper::isOpenIdAuthentication(
url,
connection->m_isOpenId);
这是错误,两个项目都使用 unicode,我可以通过使用 LPCTSTR 来解决它,但我很想知道问题是什么。
error LNK2019: unresolved external symbol "public: static class
ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class
ATL::ChTraitsCRT<wchar_t> > > __cdecl
AuthenticationAdapter::AuthenticationHelper::isOpenIdAuthentication(class
ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class
ATL::ChTraitsCRT<wchar_t> > >,bool &)"
(?isOpenIdAuthentication@AuthenticationHelper@AuthenticationAdapter@@SA?AV?
$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@V34@AA_N@Z)
referenced in function "public: class CServerConnection * __thiscall
CGlobalData::getAuthDetails(wchar_t const *,wchar_t const *,int)" (?
getAuthDetails@CGlobalData@@QAEPAVCServerConnection@@PB_W0H@Z)
【问题讨论】: