I'm trying to build an ape server on Centos 5.6 but getting the following message:

/usr/bin/ld: cannot find -lmysqlclient_r collect2: ld returned 1 exit status make: * [modules] Error 1

How can I get it working? I've found libmysqlclient_r.so in /usr/lib64/mysql and /usr/lib/mysql/ are these the files it needs? If so, how can i get ld to see them?

link|improve this question

50% accept rate
feedback

2 Answers

You probably need to install the -devel RPM for MySQL.

To see whether that's available, try:

yum provides '*/libmysqlclient_r.so'

If for some reason it's not been seen, you can try:

LD_LIBRARY_PATH=/usr/lib64/mysql make
link|improve this answer
I already have it installed under mysql-devel! – Paul Jun 9 '11 at 22:12
try the command above to see if it helps. – Phil Jun 9 '11 at 22:14
no, still the same response – Paul Jun 10 '11 at 7:15
feedback

To make this work, you must edit the Makefile in the modules directory. On line 7 change

    MYSQL_FLAGS = -L./deps/mysac/ -I./deps/mysac/ -lmysac -lmysqlclient_r

to

    MYSQL_FLAGS = -L./deps/mysac/ -L/usr/lib64/mysql -I./deps/mysac/ -lmysac -lmysqlclient_r
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.