0

using managed C++ CLR x86

Error 3 error LNK2028: unresolved token (0A000054) "extern "C" wchar_t * __stdcall StrStrIW(wchar_t const *,wchar_t const *)" (?StrStrIW@@$$J18YGPA_WPB_W0@Z) referenced in function "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

Error 2 error LNK2020: unresolved token (06000003) Attach.mydll::GetTargetThreadIDFromProcName c:\Users\ATOM-NA\documents\visual studio 2013\Projects\Attach\Attach\Source.obj Attach

Error 1 error LNK2020: unresolved token (06000002) Attach.mydll::Prepare c:\Users\ATOM-NA\documents\visual studio 2013\Projects\Attach\Attach\Source.obj Attach

Error 4 error LNK2019: unresolved external symbol "extern "C" wchar_t * __stdcall StrStrIW(wchar_t const *,wchar_t const *)" (?StrStrIW@@$$J18YGPA_WPB_W0@Z) referenced in function "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

Error 5 error LNK1120: 4 unresolved externals c:\users\atom-na\documents\visual studio 2013\Projects\Attach\Debug\Attach.dll Attach

include

using namespace System;

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

This function runs flawless in regular C++

This is my first time using C++ CLR.

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

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

i think the error is comming from the data type const char *ProcName


After attaching shlwapi.lib

Error 2 error LNK2020: unresolved token (06000003) Attach.mydll::GetTargetThreadIDFromProcName c:\Users\ATOM-NA\documents\visual studio 2013\Projects\Attach\Attach\Source.obj Attach

Error 1 error LNK2020: unresolved token (06000002) Attach.mydll::Prepare c:\Users\ATOM-NA\documents\visual studio 2013\Projects\Attach\Attach\Source.obj Attach

Error 3 error LNK1120: 2 unresolved externals c:\users\atom-na\documents\visual studio 2013\Projects\Attach\Debug\Attach.dll 1 1 Attach

THE AMAZING
  • 1,496
  • 2
  • 16
  • 38

0 Answers0