▲ 3 r/cpp_questions
Hey, everyone! Building my first project I ran into issue:
// Memory.h
namespace memory
{
void Intercept(uchar op, void* dest, void* addr);
void MakeCall(void* dest, void* addr) { Intercept(0xE8, dest, addr); }
void MakeJump(void* dest, void* addr) { Intercept(0xE9, dest, addr); }
}
// Game.cpp
#include "Memory.h"
namespace game
{
memory::MakeJump((void*)0x546789, (void*)0x5469A0);
}
This doesn't compile; I get 3 errors:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2365: 'memory::MakeJump': redefinition; previous definition was 'function
E:\proj\source\Memory.h(18,8):
see declaration of 'memory::MakeJump'
error C2513: 'memory::MakeJump': no variable declared before '='
Why is it asking for var, if memory::MakeJump returns void?
u/FreakinApplePie2579 — 14 days ago