我试图调用我的模板化函数但没有成功:(
我的 memaddr.h:
#ifndef __MEM_ADDR_WRITER__
#define __MEM_ADDR_WRITER__
#include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
namespace MemAddr {
template <typename WRITABLE>
int WriteMemoryAddress(const char* process, unsigned long address, WRITABLE value);
}
#endif
来电:
byte value = 0xEB;
MemAddr::WriteMemoryAddress("jamp.exe", 0x004392D2, value);
错误信息:
undefined reference to `int MemAddr::WriteMemoryAddress<unsigned char>(char const*, unsigned long, unsigned char)`
答:需要在标题中定义模板.. (@Shaggi)