2

I'm trying to compile this source code I have from a developers website that made his personal small MMO public, when trying to compile I get:

gcc -O -g -m32 -rdynamic -L/usr/lib/mysql -o server .obj/server.o .obj/io.o .obj/libload.o .obj/tool.o .obj/sleep.o .obj/log.o .obj/create.o .obj/notify.o .obj/skill.o .obj/do.o .obj/act.o .obj/player.o .obj/rdtsc.o .obj/los.o .obj/light.o .obj/map.o .obj/path.o .obj/error.o .obj/talk.o .obj/drdata.o .obj/death.o .obj/database.o .obj/see.o .obj/drvlib.o .obj/timer.o .obj/expire.o .obj/effect.o .obj/command.o .obj/date.o .obj/container.o .obj/store.o .obj/mem.o .obj/sector.o .obj/chat.o .obj/statistics.o .obj/mail.o .obj/player_driver.o .obj/clan.o .obj/lookup.o .obj/area.o .obj/task.o .obj/punish.o .obj/depot.o .obj/prof.o .obj/motd.o .obj/ignore.o .obj/tell.o .obj/clanlog.o .obj/respawn.o .obj/poison.o .obj/swear.o .obj/lab.o .obj/consistency.o .obj/btrace.o .obj/club.o .obj/teufel_pk.o .obj/questlog.o .obj/badip.o -lmysqlclient -lm -lz -ldl -lpthread
/usr/bin/ld: cannot find -lmysqlclient

I have ran:

sudo apt-get install libmysqlclient-dev

I'm on Ubuntu 14.04 LTS any information would be great thanks.

Edit:

ubuntu@va~/astonia3_server$ ls /usr/lib
lib/    lib32/  libx32/
ubuntu@va:~/astonia3_server$ ls /usr/lib/libmysql*
ls: cannot access /usr/lib/libmysql*: No such file or directory
ubuntu@va:~/astonia3_server$ ls /usr/lib64/libmysql*
ls: cannot access /usr/lib64/libmysql*: No such file or directory

Edit 2:

/usr/share/doc/libmysqlclient-dev
/usr/share/doc/libmysqlclient18
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
/usr/lib/x86_64-linux-gnu/libmysqlclient.a
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.a
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18
/usr/lib/x86_64-linux-gnu/libmysqlclient.so
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18.0.0
  • Show me the output of ls /usr/lib/libmysql* and ls /usr/lib64/libmysql*. – drookie Feb 10 '16 at 7:16
  • @drookie put it in the bottom of the question – Datsik Feb 10 '16 at 7:20
  • No luck. Does the find /usr -name libmysqlclient\* give something ? – drookie Feb 10 '16 at 7:22
  • @drookie in the question again – Datsik Feb 10 '16 at 7:23
1

You are getting the error because:

  • you gave the linker wrong path to look for a shared library
  • even with correct path you will get another error, because you are requesting to build 32-bit binaries, and you have 64-bit libraries.

Start building binaries matching your arch, either by issuing -m64 or leaving the default. Or get the 32-bit shared libraries, if you need 32-bit binaries.

And this is more like SO question, rather than SF.

  • Any idea where I might get 32 bit libraries for mysql? – Datsik Feb 10 '16 at 7:28
  • Why do you need them in the first place ? You have an amd64 arch system. On whether to get them -not sure, I'm not much of the Debian/Ubuntu fan. At least you can build a local 32-bit mysql in custom prefix, this is pretty easy. But may be there's a conventional way of getting them in Ubuntu. This is a matter of another question anyway. – drookie Feb 10 '16 at 7:30
  • Thanks, this source code I downloaded is just 32 bit I believe so I don't know if I can compile it for 64 bit. – Datsik Feb 10 '16 at 7:32
  • You should suppose that it can by default, unless it's explicitly configured not to. – drookie Feb 10 '16 at 7:36

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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