This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Problems with mysql.mod

Discussion of Eggdrop's code and module programming in C.
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Problems with mysql.mod

Post by Buffy_25 »

Hi,

I'm having a problem with installing mysql.mod.
(i have mysql installed with RH9.0 and it's running)

I downloaded the mysql.mod.0.6.tar.bz2 from barkerjr.net and unzipped it in eggdrop1.6.17/src/mod.
Went back to eggdrop1.6.17 dir, and did "make config"
After this i did "make"
I got a en error telling my in one of the lines : mysql.h : No such file or directory
(i tried to locate this file, but idd i couldn't find it)
So i browsed the forum and found that i had to install the mysql-dev
I did it with apt-get install mysql-devel (it installed mysql-server + mysql-devel)
After this i did again the "make" in eggdrop1.6.17 but got the following error:
make[1]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src'
This may take a while. Go get some runts.

make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/md5'
make[2]: Nothing to be done for `md5'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/md5'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/compat'
make[2]: Nothing to be done for `compat'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/compat'

---------- Yeah! That's the compiling, now the linking! ----------

Linking eggdrop (standard build).

gcc -pipe -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o
dcc.o
dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o
modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o
userent.o userrec.o users.o -L/usr/local/lib -ltcl8.4 -lm -ldl -lnsl
md5/md5c.o compat/*.o `cat mod/mod.xlibs`
touch ../eggdrop

Successful compile: eggdrop

make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src'
make[1]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/assoc.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/assoc.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/blowfish.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/blowfish.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/channels.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/channels.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/console.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/console.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/ctcp.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/ctcp.mod'make[2]: Entering
directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/dns.mod'make[2]:
Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/dns.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/filesys.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/filesys.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/irc.mod'make[2]: Nothing to be
done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/irc.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/megahal.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/megahal.mod'
make[2]: Entering directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
gcc -pipe -shared -nostartfiles -o ../../../mysql.so ../mysql.o
`mysql_config --libs`
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[2]: *** [../../../mysql.so] Error 1
make[2]: Leaving directory
`/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
make[1]: *** [mysql.mod_so] Error 2
make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
make: *** [modules] Error 2
Could someone help me how i could continue?
Thank you.

Buffy
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

This has nothing to do with Scripting Help. :P

Posts of this nature are made in Modules & Programming.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Ah sorry guys. My mistake :roll:

I already did the following:

- installed mysql-devel -> apt-get install mysql-devel
- before doing make i did: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mysql
- when i do at shell command: find / -name libmysql* (i got this then)
/usr/lib/mysql/libmysqlclient.so.10.0.0
/usr/lib/mysql/libmysqlclient.so.10
/usr/lib/mysql/libmysqlclient_r.so.10.0.0
/usr/lib/mysql/libmysqlclient_r.so.10
/usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libmysqlclient.so
/usr/lib/mysql/libmysqlclient_r.a
/usr/lib/mysql/libmysqlclient_r.so
- this is what i have in etc/ld.so.conf :
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/qt-3.1/lib
/usr/lib/mysql (i also tried to make it just /usr/lib)
/usr/local/lib/libtcl8.4.so
Can someone help me a bit more please?

Buffy
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

I thought i found the problem, after echo'ing a variable:
echo $LD_LIBRARY_PATH
:/usr/lib/mysql:/usr/lib/mysql:/usr/lib/mysql
So i did :
export LD_LIBRARY_PATH=/usr/lib/mysql
echo $LD_LIBRARY_PATH
/usr/lib/mysql
After this i retried 'make config' and then 'make' in my eggdrop1.6.17 dir,
But in vain :cry:

Thank you for your assistance.

Buffy
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

In my config i have the following:
# mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Options:
--cflags [-I'/usr/include/mysql']
--libs [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm]
--socket [/var/lib/mysql/mysql.sock]
--port [3306]
--version [3.23.58]
You have new mail in /var/spool/mail/root
Shouldn't i change something in the makefile file from eggdrop1.6.17?
I read something about LDFLAGS,... but i'm not sure though :?

Can someone help me a bit more please? (or did i forget any steps to check)

Thanks.

Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

add --cflags output to CFLAGS options and --libs output to LDFLAGS options in bot's Makefile (after make config and before make)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Hello demond,

So first i went back into my eggdrop1.6.17 dir and typed: make config
After this, i edited my Makefile (eggdrop1.6.17) as below:
#
# This is the Makefile for EGGDROP (the IRC bot)
# You should never need to edit this.
#
# $Id: Makefile.in,v 1.39 2004/07/25 11:17:33 wcc Exp $

SHELL = /bin/sh
top_srcdir = .
srcdir = .



prefix = ${HOME}/eggdrop
DEST = ${prefix}
EGGEXEC = eggdrop
EGGVERSION = 1.6.17

# things you can put here:
# -Wall if you're using gcc and it supports it
# (configure usually detects this anyway now)
#
# -DDEBUG_ASSERT to enable assert debugging
# -DDEBUG_MEM to be able to debug memory allocation (.debug)
# These can both be set by using 'make debug'
# or 'make sdebug'
CFLGS =

# ./configure SHOULD set these; however you may need to tweak them to
# get modules to compile. If you do, PLEASE let the development team know,
# so we can incorporate needed changes into the next release. You can
# contact us at eggdev@eggheads.org, as always.

# Compiler
CC = gcc -pipe
MOD_CC = gcc -pipe
SHLIB_CC = gcc -pipe -fPIC
CFLAGS=-I/usr/include/mysql
LDFLAGS=-L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm


# Linker
LD = gcc -pipe
MOD_LD = gcc -pipe
SHLIB_LD = gcc -pipe -shared -nostartfiles

# Stripping
...
After this, i run the command : Make
But i got the same error:
# make
make: *** Warning: File `Makefile' has modification time in the future (2005-11-10 17:52:12 > 2005-11-10 12:53:38.961234)
make[1]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src'
This may take a while. Go get some runts.

make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/md5'
make[2]: Nothing to be done for `md5'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/md5'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/compat'
make[2]: Nothing to be done for `compat'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/compat'

---------- Yeah! That's the compiling, now the linking! ----------

Linking eggdrop (standard build).

gcc -pipe -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o
dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o userent.o userrec.o users.o -L/usr/local/lib -ltcl8.4 -lm -ldl -lnsl md5/md5c.o compat/*.o `cat mod/mod.xlibs`
touch ../eggdrop

Successful compile: eggdrop

make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src'
make[1]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/assoc.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/assoc.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/blowfish.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/blowfish.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/channels.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/channels.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/console.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/console.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/ctcp.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/ctcp.mod'make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/dns.mod'make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/dns.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/filesys.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/filesys.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/irc.mod'make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/irc.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/megahal.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/megahal.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
gcc -pipe -shared -nostartfiles -o ../../../mysql.so ../mysql.o `mysql_config --libs`
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[2]: *** [../../../mysql.so] Error 1
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
make[1]: *** [mysql.mod_so] Error 2
make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
Did i edited the makefile wrongly?

Thanks in advance.

Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

check out also src/Makefile
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

oops, your mysql.mod Makefile is screwed, fix it

try with -Bshareable instead of -shared
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Hi demon.
Thanks for helping me with this.

But i got lost:
I edited the makefile in Eggdrop1.6.17 main dir.
So i had added the 2 lines below (bold in my previous msg)
CFLAGS=-I/usr/include/mysql
LDFLAGS=-L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
I think you meant that i had to add those outputs to another makefile?
The one in source? or the one in mysql.mod?

So i deleted again the modifications i did to the makefile in eggdrop1.6.17 main dir.

Before i screw everything up, i'll wait for your confirmation (or further actions)

Thanks.

Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

check /usr/lib/mysql/libmysql* files

maybe a link is broken (libmysqlclient.so should be a link), or file permissions are not right ones

and try what I said in my last post (replace -shared with -Bshareable in mysql.mod Makefile)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Hi demond,

I looked for the libmysql* files, and i have the following:
/usr/lib/mysql/libmysqlclient.so.10.0.0
/usr/lib/mysql/libmysqlclient.so.10
/usr/lib/mysql/libmysqlclient_r.so.10.0.0
/usr/lib/mysql/libmysqlclient_r.so.10
/usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libmysqlclient.so
/usr/lib/mysql/libmysqlclient_r.a
/usr/lib/mysql/libmysqlclient_r.so
I checked the link on libmysqlclient.so (it's linking to libmysqlclient.so.10.0.0)
And the file permissions for the dir /usr/lib/mysql are:
owner: rxw
group: rx
other: rx
Additionally, I checked for the Makefile (in mysql.mod) to change that setting, but i couldn't find the -shared in that makefile. Also, it couldn't be found in the Makefile of:
- eggdrop1.6.17/src/mod/
- eggdrop1.6.17/src/

But, i found that -shared setting in the Makefile in /eggdrop1.6.17/
I changed that into -Bshareable But i still got the same error:
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/megahal.mod'
make[2]: Entering directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
gcc -pipe -Bshareable -nostartfiles -o ../../../mysql.so ../mysql.o `mysql_config --libs`
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[2]: *** [../../../mysql.so] Error 1
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
make[1]: *** [mysql.mod_so] Error 2
make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
make: *** [modules] Error 2
Since i got the same problem, i have put back -shared as setting.

Do you want me to post the content of each MakeFile i have in the different dir's of my eggdrop1.6.17?
(i didn't edit anything else, exept the things you told me to add...if still same error, i rechanged all as origine to avoid to screw it)

Are there any other possibilities that i could check why i'm getting this error?

Thanks.

Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

copy mysql libs & links (and fix the links if necessary) to /usr/lib
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
B
Buffy_25
Halfop
Posts: 63
Joined: Sat Nov 22, 2003 6:36 am

Post by Buffy_25 »

Hi demond.

Thnx for your reply.

I copied all my mysql lib & links (/usr/lib/mysql/) into /usr/lib/
(i had to recreate a link from libmysqlclient.so and libmysqlclient.so.10 to libmysqlclient.so.10.0.0 and same for libmysqlclient_r.so and libmysqlclient_r.so.10 link to libmysqlclient_r.so.10.0.0)

But now i got a different error:
gcc -pipe -shared -nostartfiles -o ../../../mysql.so ../mysql.o `mysql_config --libs`
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [../../../mysql.so] Error 1
make[2]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod/mysql.mod'
make[1]: *** [mysql.mod_so] Error 2
make[1]: Leaving directory `/home/Buffy/mydir/eggdrop1.6.17/src/mod'
make: *** [modules] Error 2
Maybe we are already a step further ? :)

Thank you for your assistance.

Buffy
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

there is something wrong with your gcc installation

anyway.. proceed as before, locate libz and copy it to /usr/lib
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply