PDA

View Full Version : Linux Errors - READ ME BEFORE YOU ASK A QUESTION!


Acolyte
06-04-2003, 04:29 AM
The purpose of this document is to help people that may have installed mysql RPM's directly from MySql's site. Trying to do a make on EMuShareMem will generate the following error:

EMuShareMem]# make
gcc -g -shared -Wl,-soname,libEMuShareMem.so -o libEMuShareMem.so MMFMutex.o Doors.o Items.o Spells.o NPCTypes.o NPCFactionLists.o MMF.o Loot.o ../common/timer.o ../common/unix.o ../common/EMuShareMem.o -L. -lstdc++ -lm -lz `mysql_config --libs`
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [libEMuShareMem.so] Error 1


This is caused by incorrect RPM install path in MySql's RPM file (not pointing to the right location of mysqlclient). Below is a NEW makefile that will fix your problem. You can copy and paste this into your EMuShareMem makefile and do a regular make (NOTE:If this still does not work for you, check your mysql directories and make the change in the makefile accordingly):



APP=libEMuShareMem.so
SF=MMFMutex.o Doors.o Items.o Spells.o NPCTypes.o NPCFactionLists.o MMF.o Loot.o ../common/timer.o ../common/unix.o ../common/EMuShareMem.o

CC=gcc
LD=ld
DFLAGS=-DDEBUG=1 -DSHAREMEM -DCATCH_CRASH
WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wstrict-prototypes -Wno-deprecated -Wnested-externs -Wcomment -Wcast-align
OPTS=$(WFLAGS) $(DFLAGS) -g -fPIC -O2 -D_GNU_SOURCE -DINVERSEXY -DFX `/usr/bin/mysql_config --cflags` -DEMUSHAREMEM
LINKOPTS=-L. -lstdc++ -lm -lz -L/usr/lib/mysql -L/usr/local/mysql/lib -lmysqlclient -ldl





all: $(APP)



$(APP): $(SF)
$(CC) -g -shared -Wl,-soname,$(APP) -o $(APP) $(SF) $(LINKOPTS)

clean:
rm -f $(SF) $(APP)

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

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





I hope this works for you. Please post here if you have any questions or comments or just want to date me.

The Acolyte

ADDENDUM:

If you get the following error when loading world:

[Status] CURRENT_WORLD_VERSION:EQEMu 0.4.4
[Error] CURRENT_WORLD_VERSION:EQEMu 0.4.4
Loading Variables, zone names & items...
LoadEMuShareMemDLL::Load() failed to load library error=Error: Could not load item data. But ignoring
...done.
LoginServer.ini read.
Loading guild ranks...done.
Loading EQ time of day...failed.
Deleted 0 stale player corpses from database.
Deleted -1 stale player backups from database.
Breaking linux compiles....
TCP listening on: xxx.xxx.xxx.xxx:9000
World server listening on: xxx.xxx.xxx.xxx:9000
Connected to LoginServer: eqlogin2.eqemu.net:5999
Login server responded with FatalError. Disabling reconnect.
Error message: 'Bad server name. Unknown reason.'
xxx.xxx.xxx.xxx:5999: TCPConnection::SendData(): send(): Errorcode: Broken pipe

Put EQEmuShareMem.so into /usr/lib

Also take note of:
Error message: 'Bad server name. Unknown reason.'

You can't use the word SERVER in your Servername, nor can it be 4? charachters or less.

Proximo
09-26-2003, 02:29 AM
I just tried that new makefile, unfortunately the result is this:

Proximo@localhost EMuShareMem]# make
makefile:14: *** missing separator. Stop.

Is there a fix for this? I've managed to compile the other bins, but i will be the first to admit i'm quite new to Linux and makefiles. Thank you.

Proximo
09-26-2003, 02:35 AM
Forgive my stupidity. I had not realised that by copying and pasting your make file I destroyed the TABs needed for separation. It now compiles, thank you.

farce
12-21-2003, 07:21 PM
be sure you have gcc-c++, libstd++=devel, zlib-devel installed too.

bushman77
05-27-2005, 10:20 AM
ok i've been able to get the libemusharemem and world to compile with no fuss, it is when i get to zone do i encounter the -lmysqlclient not found. Is this the same issue the that you had 1st described with the EMuSharemem.so or would a new makefile have ot be created??