Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 09-19-2005, 10:09 AM
johane
Sarnak
 
Join Date: Sep 2005
Location: Gold Coast, Oz
Posts: 69
Default How to fix linker errors

Quote:
Originally Posted by Darkmeerkat
Thanks, that got me past that part. Now it just throws this error:

I'm assuming it's choking trying to find the MySQL libraries (Which are located in /usr/local/bin/mysql/lib, but linked to in /usr/bin). I dinked around with it a little, and eventually modified the decleration part of the makefile to::
Code:
CC=gcc
LINKER=gcc
MYSQL_FLAGS=`mysql_config --cflags`
# Making this link directly to the libs didn't work. (returned "/usr/local/bin/mysql/lib is a directory", then a bunch of undefined errors.)
#MYSQL_LIB=`/usr/local/bin/mysql/lib/`
DFLAGS=-DEQDEBUG=5 -DNO_PIDLOG -DSHAREMEM -DSPELL_EFFECT_SPAM -DFIELD_ITEMS
WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wstrict-prototypes -Wno-deprecated  -Wcomment -Wcast-align
COPTS=$(WFLAGS) -O2 -ggdb -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS)
#LINKOPTS=-rdynamic -L. -lstdc++ -ldl $(MYSQL_LIB)
LINKOPTS=-rdynamic -L. -lstdc++ -ldl -L/usr/bin -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc-lnss_files -lnss_dns -lresolv
It now returns this when I make it:

Am I not including the right libraries?

This is a common problem with development code in many projects. To resolve it (OK, bad joke I know!) use grep:

Code:
cd ${your_source_directory}
grep -r "Object::MethodName" | grep cpp
You'll get a list of all the places that the symbol is used in the cource code. Look at the list, and select a likely culprit - let's assume we decide "common/opcodemgr.cpp" is a good one to try.

Check that it's not in the "APP" line in the makefile. Then APPEND it to that line. Rerun "make clean && make".

Either that fixes it (and possibly another link error shows itself) or it doesnt, in which case you replace the thing you added to the makefile with another likely suspect.

Note that not knowing this kind of stuff suggests you are a bit out of your depth, and a course or decent book on C++ might be a good idea. There's some decent stuff in the LDP (Programming HOWTO for example )to read if you are very bright.

Last edited by johane; 09-19-2005 at 06:11 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:41 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3