.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   HPB_bot (http://forums.bots-united.com/forumdisplay.php?f=35)
-   -   can't make the hpb bot template compile (http://forums.bots-united.com/showthread.php?t=2748)

theturtle 04-10-2004 09:38

can't make the hpb bot template compile
 
hi guys !
i have a problem when compiling the HPB Bot Template #4 (using the latest cygwin version)
here is the output :

Code:

C:\projet_bot_cs\hpb_bot_template_4\HPB_bot\dlls>make

gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c bot.cpp -o b
ot.o

gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c bot_client.c
pp -o bot_client.o

gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c bot_combat.c
pp -o bot_combat.o

gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c bot_navigate
.cpp -o bot_navigate.o

gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c bot_start.cp
p -o bot_start.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c dll.cpp -o d
ll.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c engine.cpp -
o engine.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c h_export.cpp
 -o h_export.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c linkfunc.cpp
 -o linkfunc.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c util.cpp -o
util.o
gcc -march=pentium -O2 -w -I../engine -I../common -I../pm_shared -c waypoint.cpp
 -o waypoint.o
dllwrap -s --output-def HPB_bot_ming.def --driver-name gcc -o HPB_bot.dll \
        bot.o bot_client.o bot_combat.o bot_navigate.o bot_start.o dll.o engine.
o h_export.o linkfunc.o util.o waypoint.o
dllwrap: no export definition file provided.
Creating one, but that may not be what you want
type GiveFnpt.dat >> HPB_bot_ming.def
dllwrap -s --def HPB_bot_ming.def --driver-name gcc -o HPB_bot.dll \
        bot.o bot_client.o bot_combat.o bot_navigate.o bot_start.o dll.o engine.
o h_export.o linkfunc.o util.o waypoint.o
HPB_bot.exp(.edata+0x87c):fake: undefined reference to `GiveFnptrsToDll__FP13eng
inefuncs_sP12globalvars_t@8'
dllwrap: gcc exited with status 1
make: *** [HPB_bot.dll] Error 1

i don't understand why it can't find the GiveFnPtrsToDll function as it is declared in h_export.o ....
could someone please help me ? i'm going crazy :'(

theturtle 04-10-2004 09:42

Re: can't make the hpb bot template compile
 
excuse me but i don't manage to make carriage return in the CODE tag...
the revelant part of the error is :

dllwrap -s --def HPB_bot_ming.def --driver-name gcc -o HPB_bot.dll bot.o bot_client.o bot_combat.o bot_navigate.o bot_start.o dll.o engine.o h_export.o linkfunc.o util.o waypoint.o
HPB_bot.exp(.edata+0x87c):fake: undefined reference to `GiveFnptrsToDll__FP13enginefuncs_sP12globalvars_t @8'
dllwrap: gcc exited with status 1

theturtle 04-10-2004 10:30

Re: can't make the hpb bot template compile
 
It works now !

I was in fact using (didn't noticed it) mingw-gcc 3.x... downloading & installing the separate archive mingw-gcc-2.95.x solved my problems...

So, i want to suggest a few things to improve the HPB Bot template #4 :

* put a README with a warning in it, telling that people should (MUST?) use gcc-2.95.x to compile the template.
* change the makefile_mingw and put GCC=gcc-2 instead of GCC=gcc, so people will think about their gcc's version
* i had to add "#include <ctype.h>" to bot.cpp and util.cpp because this header was not included... can't understand why it compiles with your compilers... you should perhaps include these includes (hahaha) to the template to avoid peoples search where this f*$^łking function comes from
9_9

apart from these little problems, nice job for this #4 template !

botman 04-10-2004 14:57

Re: can't make the hpb bot template compile
 
Alternately, you can probably just edit GiveFnpt.dat to contain...

GiveFnptrsToDll__FP13enginefuncs_sP12globalvars_t @8

..instead of what's currently in there.

botman

Whistler 05-10-2004 06:00

Re: can't make the hpb bot template compile
 
this may be a better way:

Makefile: (for both Windows and GNU/Linux)
PHP Code:

CPP=g++
CC=gcc

#OS=linux
OS=windows

OBJ
=bot.o bot_ai.o bot_chat.o bot_client.o bot_combat.o bot_globals.o bot_navigate.o bot_sounds.o compress.o cstrike.o dllapi.o engine_api.o h_export.o linkgame.o meta_api.o namefunc.o util.o waypoint.o

CCOPT 
= -march=i586 -O6 -ffast-math -funroll-loops \
    -
fomit-frame-pointer -fexpensive-optimizations -falign-loops=\
    -
falign-jumps=-falign-functions=-fno-rtti -s

CCDEBUG 
= -ggdb3

CFLAGS 
= $(CCOPT) -I./hlsdk -I./metamod
#CFLAGS = $(CCDEBUG) -I./hlsdk -I./metamod

ifeq "$(OS)" "linux"

BASEFLAGS=-Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -w
CPPFLAGS
=${BASEFLAGS} ${CFLAGS}

podbot_i586.so:    ${OBJ}
    ${
CPP} -fPIC -shared -$@ ${OBJ} -ldl -lm

clean
:
    -
rm -*.o
    
-rm -f podbot_i586.so

else

BASEFLAGS=-w
CPPFLAGS
=${BASEFLAGS} ${CFLAGS}

PODBot.dll:    ${OBJ}
    
dllwrap -mwindows --add-stdcall-alias ${OBJ} --driver-name g++ -o PODBot.dll
    strip 
-s PODBot.dll

clean
:
    -
del *.o
    
-del podbot.dll

endif

%.
o:    %.cpp
    
${CPP} ${CPPFLAGS} -$< -$@

%.
o:    %.c
    
${CC} ${CPPFLAGS} -$< -$@ 

in h_export.cpp file:
PHP Code:

void DLLEXPORT GiveFnptrsToDllenginefuncs_tpengfuncsFromEngineglobalvars_t *pGlobals )


and in bot.h file:
PHP Code:

extern "C" EXPORT void DLLEXPORT GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngineglobalvars_t *pGlobals); 



All times are GMT +2. The time now is 18:14.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.