Возникла необходимость скомплить metamod плагин Monster Plugin (
http://hpb-bot.bots-united.com/monster.html) под Linux.
Познания в C++ и GoldSource у меня к сожалению небольшие, поэтому возникли трудности. Не компилится!
Буду подробно описывать свои действия, чтобы было понятнее. Первым делом я скачал сорцы с сайта Monster Plugin, скачал metamod и hlsdk с сайта metamod.org. Закинул их в корневую директорию. В итоге имею три директории:
hlsdk
metamod-1.20
monster_plugin
В файле monster_plugin/dlls/Makefile я изменил
Цитата:
CPPFLAGS = ${BASEFLAGS} -m386 -O2 -w -I. -I../engine -I../common -I../pm_shared -I../../metamod
на
Цитата:
CPPFLAGS = ${BASEFLAGS} -m32 -O2 -w -I. -I../engine -I../common -I../pm_shared -I../../metamod-1.20
Попытка #1
Код:
nikita@nikita-Lenovo-B570e:~/Documents/sources/monster_plugin/dlls$ make
gcc -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -m32 -O2 -w -I. -I../engine -I../common -I../pm_shared -I../../metamod-1.20 -c agrunt.cpp -o agrunt.o
In file included from agrunt.cpp:20:0:
util.h: In function ‘BOOL FStrEq(const char*, const char*)’:
util.h:182:27: error: ‘strcmp’ was not declared in this scope
{ return (strcmp(sz1, sz2) == 0); }
^
In file included from agrunt.cpp:21:0:
effects.h: In member function ‘void CMSprite::AnimateAndDie(float)’:
cmbase.h:296:81: error: cannot convert ‘CMSprite::AnimateUntilDead’ from type ‘void (CMSprite::)()’ to type ‘void (CMBaseEntity::*)()’
#define SetThink( a ) m_pfnThink = static_cast <void (CMBaseEntity::*)(void)> (a)
^
effects.h:82:3: note: in expansion of macro ‘SetThink’
SetThink(AnimateUntilDead);
^
effects.h: In member function ‘void CMBeam::LiveForTime(float)’:
cmbase.h:296:81: error: cannot convert ‘CMBaseEntity::SUB_Remove’ from type ‘void (CMBaseEntity::)()’ to type ‘void (CMBaseEntity::*)()’
#define SetThink( a ) m_pfnThink = static_cast <void (CMBaseEntity::*)(void)> (a)
^
effects.h:168:42: note: in expansion of macro ‘SetThink’
inline void LiveForTime( float time ) { SetThink(SUB_Remove); pev->nextthink = gpGlobals->time + time; }
^
In file included from agrunt.cpp:22:0:
cmbasemonster.h: At global scope:
cmbasemonster.h:486:14: error: extra qualification ‘CMHoundeye::’ on member ‘GetSchedule’ [-fpermissive]
Schedule_t *CMHoundeye :: GetSchedule( void );
^
agrunt.cpp: In member function ‘virtual int CMAGrunt::IRelationship(CMBaseEntity*)’:
agrunt.cpp:128:62: error: ‘strcmp’ was not declared in this scope
if ( strcmp(STRING(pTarget->pev->model), "models/hgrunt.mdl") == 0 )
^
make: *** [agrunt.o] Ошибка 1
Эту проблему я решил исправить добавлением строчки в monster_plugin/dlls/agrunt.cpp
Код:
#include <string.h>
Попытка #2
Код:
nikita@nikita-Lenovo-B570e:~/Documents/sources/monster_plugin/dlls$ make
gcc -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -m32 -O2 -w -I. -I../engine -I../common -I../pm_shared -I../../metamod-1.20 -c agrunt.cpp -o agrunt.o
In file included from agrunt.cpp:23:0:
effects.h: In member function ‘void CMSprite::AnimateAndDie(float)’:
cmbase.h:296:81: error: cannot convert ‘CMSprite::AnimateUntilDead’ from type ‘void (CMSprite::)()’ to type ‘void (CMBaseEntity::*)()’
#define SetThink( a ) m_pfnThink = static_cast <void (CMBaseEntity::*)(void)> (a)
^
effects.h:82:3: note: in expansion of macro ‘SetThink’
SetThink(AnimateUntilDead);
^
effects.h: In member function ‘void CMBeam::LiveForTime(float)’:
cmbase.h:296:81: error: cannot convert ‘CMBaseEntity::SUB_Remove’ from type ‘void (CMBaseEntity::)()’ to type ‘void (CMBaseEntity::*)()’
#define SetThink( a ) m_pfnThink = static_cast <void (CMBaseEntity::*)(void)> (a)
^
effects.h:168:42: note: in expansion of macro ‘SetThink’
inline void LiveForTime( float time ) { SetThink(SUB_Remove); pev->nextthink = gpGlobals->time + time; }
^
In file included from agrunt.cpp:24:0:
cmbasemonster.h: At global scope:
cmbasemonster.h:486:14: error: extra qualification ‘CMHoundeye::’ on member ‘GetSchedule’ [-fpermissive]
Schedule_t *CMHoundeye :: GetSchedule( void );
^
make: *** [agrunt.o] Ошибка 1