私は 2 つのエラーが発生し、私の人生のためにそれを理解することはできません.私は、過去数時間、Google で調査しました. 私は今どこにいるのですか。これが私が得ているコンパイルエラーです。
2 IntelliSense: identifier "RegisterShader" is undefined c:\users\administrator\documents\visual studio 2010\projects\test\dllmain.cpp 18 20
Error 1 error C3861: 'RegisterShader': identifier not found c:\users\administrator\documents\visual studio 2010\projects\test\dllmain.cpp 50 1
// stdafx.h
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here
#include <detours.h>
#include "typedefs.h"
// stdafx.cpp
// stdafx.cpp : source file that includes just the standard includes
// blopsII.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
// typedefs.h
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
#define OFF_REGISTERSHADER 0x00715690
typedef float vec_t;
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef int qhandle_t;
typedef int ( * tRegisterShader )( char* szName, int unk );
#endif
// typedefs.cpp
#include "stdafx.h"
tRegisterShader RegisterShader = ( tRegisterShader )OFF_REGISTERSHADER;
// dllmain.cpp
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
//#include "typedefs.h"
DWORD dwHook = 0x6ADC30;
void callback()
{
qhandle_t white = RegisterShader("white", 3);
}
int __cdecl hkRender()
{
_asm pushad;
callback();
_asm popad;
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}