List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:December 10 2001 9:05pm
Subject:mysqlclient linking question
View as plain text  

>>>>> "Hans" == Hans Zaunere <zaunere@stripped> writes:

Hans> I use the -lmysqlclient  command line argument to gcc
Hans> under Linux.  It compiles fine and everything works
Hans> great.

Hans> However, if I move the compiled binary to another
Hans> system, which doesn't have the mysql client libs
Hans> installed, when I try to start the program, I get:

Hans> error while loading shared libraries:
Hans> cannot open shared object file:
Hans> No such file or directory


Hans> If someone could explain to me why this behavior is
Hans> happending, and maybe a little linking/shared/static
Hans> background, since I am confused now (thinking that .a
Hans> libs always are statically linked automatically).  I
Hans> understand I could use -static, but since -l uses a .a
Hans> lib filename, I thought this would be implied.

We are using libtool to configure MySQL and it can easily get you into
trouble like the above becasue, by default, all programs are linked shared

The normal way to solve this is to not move binaries directly but
first install all binaries and shared libraries to 'their proper place'
with 'make install'.

After this you can then move the installed binaries, as the incompiled
path to the shared library will work.

What binary do you want to move and why ?


For technical support contracts, goto
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Michael Widenius <monty@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, CTO
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
mysqlclient linking questionHans Zaunere8 Dec
  • mysqlclient linking questionMichael Widenius10 Dec
  • Re: mysqlclient linking questionSinisa Milivojevic10 Dec