Quote:
Originally Posted by psychonic
You need to compile in the sourcehook files from MM:S. It can't use MM:S's copy at runtime since it's a VSP, not an MM:S plugin (due to it needing to load earlier).
|
Yea, I guessed that somehow..
Now, the standard Makefile only supports .o and .a files, so I would need to compile SH to an *.a (static lib) first.
Or would I simply copy the sourcehook*.cpp into the Plugin's source directory?
EDIT:
I have just put the SH cpp files into the Plugin's Source directory and modified the Makefile.
Now it prints out the following Errors:
Code:
../public/tier0/memoverride.cpp: In function ‘void* AllocUnattributed(size_t)’:
../public/tier0/memoverride.cpp:100:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* ReallocUnattributed(void*, size_t)’:
../public/tier0/memoverride.cpp:105:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* operator new(unsigned int, int, const char*, int)’:
../public/tier0/memoverride.cpp:370:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void operator delete(void*)’:
../public/tier0/memoverride.cpp:375:2: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* operator new [](unsigned int, int, const char*, int)’:
../public/tier0/memoverride.cpp:385:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void operator delete [](void*)’:
../public/tier0/memoverride.cpp:390:2: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* _nh_malloc_dbg(size_t, int, int, const char*, int)’:
../public/tier0/memoverride.cpp:444:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* _malloc_dbg(size_t, int, const char*, int)’:
../public/tier0/memoverride.cpp:451:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* _calloc_dbg(size_t, size_t, int, const char*, int)’:
../public/tier0/memoverride.cpp:458:15: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* _realloc_dbg(void*, size_t, int, const char*, int)’:
../public/tier0/memoverride.cpp:467:9: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void _free_dbg(void*, int)’:
../public/tier0/memoverride.cpp:480:2: error: ‘g_pMemAlloc’ was not declared in this scope
../public/tier0/memoverride.cpp: In function ‘void* _realloc_dbg(void*, size_t, int, const char*, int)’:
../public/tier0/memoverride.cpp:468:1: warning: control reaches end of non-void function [-Wreturn-type]
../public/tier0/memoverride.cpp: In function ‘void* _malloc_dbg(size_t, int, const char*, int)’:
../public/tier0/memoverride.cpp:452:1: warning: control reaches end of non-void function [-Wreturn-type]
../public/tier0/memoverride.cpp: In function ‘void* _nh_malloc_dbg(size_t, int, int, const char*, int)’:
../public/tier0/memoverride.cpp:445:1: warning: control reaches end of non-void function [-Wreturn-type]
../public/tier0/memoverride.cpp: In function ‘void* operator new [](unsigned int, int, const char*, int)’:
../public/tier0/memoverride.cpp:386:1: warning: control reaches end of non-void function [-Wreturn-type]
../public/tier0/memoverride.cpp: In function ‘void* AllocUnattributed(size_t)’:
../public/tier0/memoverride.cpp:101:1: warning: control reaches end of non-void function [-Wreturn-type]
../public/tier0/memoverride.cpp: In function ‘void* operator new(unsigned int, int, const char*, int)’:
../public/tier0/memoverride.cpp:371:1: warning: control reaches end of non-void function [-Wreturn-type]
make[1]: *** [obj/plr/tier0/memoverride.o] Error 1
Taking a look at tier0/memalloc.h, it's defined here (and memoverride.cpp includes it), so I don't know why it complains here..
EDIT2:
Removing the TIER0_OBJ Stuff from the Makefiles fixes it, and the plugin now compiles & loads successfully!
__________________
Stopped hosting servers as of November 2018, no longer active around here.