13 Feb, 2009, Zeno wrote in the 1st comment:
Votes: 0
Changing this:
L_FLAGS = $(OPT_FLAG) $(PROF) $(SOLARIS_LINK) $(NEED_CRYPT) $(SANITY) -lz -L/usr/lib64/mysql -lmysqlclient

to this:
L_FLAGS = $(OPT_FLAG) $(PROF) $(SOLARIS_LINK) $(NEED_CRYPT) $(SANITY) -lz -L/usr/lib/mysql -lmysqlclient

Gives me errors like…
o/act_move.o: In function `move_char':
/home/zeno/dev/src/act_move.c:1292: undefined reference to `log'
/home/zeno/dev/src/act_move.c:1292: undefined reference to `pow'
o/act_move.o: In function `do_pushup':
/home/zeno/dev/src/act_move.c:3739: undefined reference to `log'
/home/zeno/dev/src/act_move.c:3739: undefined reference to `pow'
o/fight.o: In function `damage':
/home/zeno/dev/src/fight.c:2414: undefined reference to `log'
/home/zeno/dev/src/fight.c:2414: undefined reference to `pow'
/home/zeno/dev/src/fight.c:2606: undefined reference to `pow'
/home/zeno/dev/src/fight.c:2653: undefined reference to `floorl'
o/fight.o: In function `check_concentrate':
/home/zeno/dev/src/fight.c:4971: undefined reference to `log'
/home/zeno/dev/src/fight.c:4971: undefined reference to `pow'
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_close_free_options':
(.text+0xd3d): undefined reference to `SSL_CTX_free'
/usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_get_ssl_cipher':
(.text+0x1041): undefined reference to `SSL_get_current_cipher'

etc.

I have no idea why. I shouldn't be getting undefined refs to pow or floorl, math.h is correctly included in mud.h and works fine with the first Makefile line.

I was changing this because I moved from a 64bit server to a 32bit server and the lib64 is the wrong place.
13 Feb, 2009, David Haley wrote in the 2nd comment:
Votes: 0
Your problem isn't math.h, you're getting linker errors which mean that the math lib isn't being linked in. Add -lm to the linker flags to link in the math library.
13 Feb, 2009, Zeno wrote in the 3rd comment:
Votes: 0
Strange. Okay, that fixed it.

I think the other errors have to do with SSL in MySQL, not sure though.

[EDIT] Added -L/usr/local/ssl/lib -lssl -lcrypto and it works.
13 Feb, 2009, David Haley wrote in the 4th comment:
Votes: 0
Oh… I hadn't noticed those. I guess you need to figure out the library that defines those… maybe libssl. try -lssl or something like that.

It looks like the 64 bit version of the mysql library doesn't statically link in its required libraries, although the previous one did. In some sense, you were getting away with something when you were using math functions without the math lib, but you didn't notice it because mysql was providing it for you. :wink:

EDIT: ah, you edited while I was posting…
0.0/4