PDA

View Full Version : zone binary compile problems


meeble
07-11-2004, 08:39 AM
Having managed to get EQEmu running successfully on a Windows machine in the past, I decided that I wanted to also have it running on my new RedHat 9 server. I've just spent most of the day overcoming the millions of different problems I've had with the process so far, but now I've come across something which has me well and truly stuck!

I've managed to (eventually) get world and libEMuShareMem.so compiled, but I've having problems with zone.

Here are the errors when I issue the make command:


# make
gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wcomment -Wcast-align -Winline -Wno-deprecated -g -march=i686 -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD -DDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -I/usr/include/mysql -I/usr/mysql/include ../common/EQNetwork.o ../common/timer.o ../common/packet_dump.o ../common/packet_functions.o ../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o ../common/serverinfo.o ../common/moremath.o worldserver.o spells.o spawngroup.o loottables.o faction.o Map.o PlayerCorpse.o petitions.o MobAI.o Object.o ../common/eqtime.o groups.o ../common/classes.o ../common/races.o ../common/TCPConnection.o forage.o ../common/crc32.o ../common/guilds.o ../common/md5.o ../common/dbcore.o ../common/dbasync.o zonedbasync.o parser.o beacon.o ../common/EMuShareMem.o ../common/EQEMuError.o .obj/debug.o .obj/database.o .obj/Item.o .obj/misc.o doors.o command.o -rdynamic -L. -lstdc++ -lm -lz -L/usr/lib/mysql -L/usr/mysql/lib -lmysqlclient -ldl -o zone
zone.o(.text+0xdb): In function `Zone::Bootup(unsigned, bool)':
/usr/include/c++/3.2.2/bits/stl_tree.h:107: undefined reference to `Database::GetNPCType(unsigned)'
zone.o(.text+0x3282): In function `Zone::Depop()':
/root/eqemu/zone/zone.cpp:802: undefined reference to `Database::GetNPCType(unsigned)'
zone.o(.text+0x5384): In function `Database::LoadZoneState(char const*, LinkedList<Spawn2*>&)':
/root/eqemu/zone/zone.cpp:1329: undefined reference to `Database::GetNPCType(unsigned)'
client_process.o(.text+0x9a4): In function `Client::HandlePacket(APPLAYER const*)':
/root/eqemu/zone/client.h:268: undefined reference to `Database::GetAATimers(unsigned)'
spawn2.o(.text+0x38f): In function `Spawn2::Process()':
/root/eqemu/zone/spawn2.cpp:96: undefined reference to `Database::GetNPCType(unsigned)'
parser.o(.text+0x4438): In function `Parser::ExCommands(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, unsigned, Mob*, Mob*)':
/usr/include/stdlib.h:382: undefined reference to `Database::GetNPCType(unsigned)'
parser.o(.text+0xb79a):/usr/include/stdlib.h:382: undefined reference to `Database::GetNPCType(unsigned)'
command.o(.text+0x7ffd): In function `command_gassign(Client*, Seperator const*)':
/root/eqemu/zone/mob.h:311: undefined reference to `Database::AssignGrid(Client*, float, float, unsigned)'
command.o(.text+0xafe6): In function `command_npctypespawn(Client*, Seperator const*)':
/usr/include/stdlib.h:382: undefined reference to `Database::GetNPCType(unsigned)'
command.o(.text+0xc3dd): In function `command_viewnpctype(Client*, Seperator const*)':
/root/eqemu/zone/command.cpp:2901: undefined reference to `Database::GetNPCType(unsigned)'
collect2: ld returned 1 exit status
make: *** [zone] Error 1


As you can see, there are lots of "undefined reference to Database::" type errors, which lead me to believe that it's not successfully finding the database.cpp / database.h files in the common directory. However, there's nothing in my makefile which seems to be obviously causing this problem. The contents of my makefile are as follows:


APP=zone
SF=../common/EQNetwork.o \
../common/timer.o ../common/packet_dump.o ../common/packet_functions.o \
../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o \
zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o \
../common/serverinfo.o ../common/moremath.o worldserver.o spells.o spawngroup.o loottables.o \
faction.o Map.o PlayerCorpse.o petitions.o MobAI.o Object.o ../common/eqtime.o \
groups.o ../common/classes.o ../common/races.o ../common/TCPConnection.o forage.o \
../common/crc32.o ../common/guilds.o ../common/md5.o ../common/dbcore.o \
../common/dbasync.o zonedbasync.o parser.o beacon.o\
../common/EMuShareMem.o ../common/EQEMuError.o \
.obj/debug.o .obj/database.o .obj/Item.o .obj/misc.o \
doors.o command.o


CC=gcc
LINKER=gcc
DFLAGS=-DDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS
WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wcomment -Wcast-align -Winline -Wno-deprecated
COPTS=$(WFLAGS) -g -march=i686 -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD $(DFLAGS) -I/usr/include/mysql -I/usr/mysql/include
LINKOPTS=-rdynamic -L. -lstdc++ -lm -lz -L/usr/lib/mysql -L/usr/mysql/lib -lmysqlclient -ldl
all: $(APP)

$(APP): $(SF)
$(LINKER) $(COPTS) $(OBJS) $^ $(LINKOPTS) -o $@


import_raw_items: import_raw_items.o
$(LINKER) $(COPTS) $^ $(LINKOPTS) -o $@

clean:
rm -f $(SF) $(APP) import_raw_items.o import_raw_items

%.o: %.cpp
$(CC) -c $(COPTS) $< -o $@

.obj/debug.o: ../common/debug.cpp ../common/debug.h
mkdir -p .obj
$(CC) $(COPTS) -c ../common/debug.cpp -o .obj/debug.o

.obj/database.o: ../common/database.cpp ../common/database.h
mkdir -p .obj
$(CC) $(COPTS) -c ../common/database.cpp -o .obj/database.o

.obj/Item.o: ../common/Item.cpp ../common/Item.h
mkdir -p .obj
$(CC) $(COPTS) -c ../common/Item.cpp -o .obj/Item.o

.obj/misc.o: ../common/misc.cpp ../common/misc.h
mkdir -p .obj
$(CC) $(COPTS) -c ../common/misc.cpp -o .obj/misc.o


If anyone could help, I really would be eternally grateful! Thanks in advance! :)

rizzen04
07-12-2004, 12:16 AM
Which source version are you trying to compile, and the date of the release.

meeble
07-12-2004, 12:32 AM
Hi, I believe it was the latest one from cvs.biosprite.net. However, this morning, I tried compiling 0.5.6 from the SourceForge filelist, just in case it was a problem with the latest CVS release, but I still had pretty much the same problem with compiling zone:


# make
gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wcomment -Wcast-align -Winline -Wno-deprecated -g -march=i686 -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD -DDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -I/usr/include/mysql -I/usr/mysql/include ../common/EQNetwork.o ../common/timer.o ../common/packet_dump.o ../common/packet_functions.o ../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o ../common/serverinfo.o ../common/moremath.o worldserver.o spells.o spawngroup.o loottables.o faction.o Map.o PlayerCorpse.o petitions.o MobAI.o Object.o ../common/eqtime.o groups.o ../common/classes.o ../common/races.o ../common/TCPConnection.o forage.o ../common/crc32.o ../common/guilds.o ../common/md5.o ../common/dbcore.o ../common/dbasync.o zonedbasync.o parser.o beacon.o ../common/EMuShareMem.o ../common/EQEMuError.o .obj/debug.o .obj/database.o .obj/Item.o .obj/misc.o doors.o command.o -rdynamic -L. -lstdc++ -lm -lz -L/usr/lib/mysql -L/usr/mysql/lib -lmysqlclient -ldl -o zone
client_process.o(.text+0x9a2): In function `Client::HandlePacket(APPLAYER const*)':
/root/eqemu_test/zone/client.h:266: undefined reference to `Database::GetAATimers(unsigned)'
command.o(.text+0x7b4d): In function `command_gassign(Client*, Seperator const*)':
/root/eqemu_test/zone/mob.h:305: undefined reference to `Database::AssignGrid(Client*, float, float, unsigned)'
collect2: ld returned 1 exit status
make: *** [zone] Error 1


The errors I'm getting this time aren't EXACTLY the same (there's no mention of GetNPCType, for one), but it seems to be along the same lines of having undefined references to Database::whatever. :(

This is very frustrating! :cry:

sotonin
07-12-2004, 03:10 AM
sourceforge is outdated. it hasnt worked for ages. don't use it.

meeble
07-12-2004, 03:12 AM
Ok, thanks. ;) I'll scrap that one then.

Well, then, back to the CVS version...

I'm using the latest release on cvs.biosprite.net (I believe it's from 10th July), and am still having the problems outlined in the first post. :(

Any ideas, anyone? :)

Tertiary
07-12-2004, 03:37 AM
The code for GetNPCType is bracketed with #ifdef ZONE / #endif

For some reason, -DZONE is missing from your COPTS statement in the makefile, so GetNPCType is not getting compiled. Here's what mine is (unaltered from the distributed code on biosprite):

COPTS=$(WFLAGS) -O2 -ggdb -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS)

meeble
07-12-2004, 03:55 AM
The code for GetNPCType is bracketed with #ifdef ZONE / #endif

For some reason, -DZONE is missing from your COPTS statement in the makefile, so GetNPCType is not getting compiled. Here's what mine is (unaltered from the distributed code on biosprite):

COPTS=$(WFLAGS) -O2 -ggdb -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS)



Tertiary - Ahh, thank you, that did the trick. :) I must have taken it out when I was editing the mysql flags and forgotten to put it back in. Thanks so much! :)