我不明白的错误。 C ++ CLR(StrStrI)这很疯狂

时间:2015-02-24 01:07:50

标签: c++ clr

使用托管C ++ CLR x86

  

错误3错误LNK2028:未解析的令牌(0A000054)“extern”C“wchar_t   * __stdcall StrStrIW(wchar_t const *,wchar_t const *)“(?StrStrIW @@ $$ J18YGPA_WPB_W0 @ Z)在函数”unsigned long“中引用   __cdecl Attach :: GetTargetThreadIDFromProcName(wchar_t const *)“(?GetTargetThreadIDFromProcName @ Attach @@ $$ FYAKPB_W @ Z)c:\ Users \ ATOM-NA \ documents \ visual   studio 2013 \ Projects \ Attach \ Attach \ Source.obj Attach

     

错误2错误LNK2020:未解析的令牌(06000003)   Attach.mydll :: GetTargetThreadIDFromProcName c:\ Users \ ATOM-NA \ documents \ visual   studio 2013 \ Projects \ Attach \ Attach \ Source.obj Attach

     

错误1错误LNK2020:未解析的令牌(06000002)   Attach.mydll ::准备c:\ Users \ ATOM-NA \ documents \ visual studio   2013 \ Projects \ Attach \ Attach \ Source.obj附加

     

错误4错误LNK2019:未解析的外部符号“extern”C“wchar_t   * __stdcall StrStrIW(wchar_t const *,wchar_t const *)“(?StrStrIW @@ $$ J18YGPA_WPB_W0 @ Z)在函数”unsigned long“中引用   __cdecl Attach :: GetTargetThreadIDFromProcName(wchar_t const *)“(?GetTargetThreadIDFromProcName @ Attach @@ $$ FYAKPB_W @ Z)c:\ Users \ ATOM-NA \ documents \ visual   studio 2013 \ Projects \ Attach \ Attach \ Source.obj Attach

     

错误5错误LNK1120:4个未解析的外部c:\ users \ atom-na \ documents \ visual studio 2013 \ Projects \ Attach \ Debug \ Attach.dll Attach

包括

使用命名空间系统;

namespace Attach
{
    public ref class mydll
    {
    public : bool mydll::Inject(LPCWSTR hackname);
    private : bool Prepare(const char * DLL_NAME); //Param causes error
    };
}

此函数在常规 C ++

中运行完美

这是我第一次使用C ++ CLR。​​

参考:StrStrI https://msdn.microsoft.com/en-us/library/windows/desktop/bb773439%28v=vs.85%29.aspx

PTSTR StrStrI(
  _In_  PTSTR pszFirst,
  _In_  PCTSTR pszSrch
);

我认为错误来自数据类型 const char * ProcName


附上shlwapi.lib

  

错误2错误LNK2020:未解析的令牌(06000003)   Attach.mydll :: GetTargetThreadIDFromProcName c:\ Users \ ATOM-NA \ documents \ visual   studio 2013 \ Projects \ Attach \ Attach \ Source.obj Attach

     

错误1错误LNK2020:未解析的令牌(06000002)   Attach.mydll ::准备c:\ Users \ ATOM-NA \ documents \ visual studio   2013 \ Projects \ Attach \ Attach \ Source.obj附加

     

错误3错误LNK1120:2未解决   externals c:\ users \ atom-na \ documents \ visual studio   2013 \ Projects \ Attach \ Debug \ Attach.dll 1 1附加

0 个答案:

没有答案