List:Internals« Previous MessageNext Message »
From:Hans Zaunere Date:December 8 2001 9:05pm
Subject:mysqlclient linking question
View as plain text  
I use the -lmysqlclient  command line argument to gcc
under Linux.  It compiles fine and everything works
great.

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

error while loading shared libraries:
libmysqlclient.so.10: cannot open shared object file:
No such file or directory

Now after reading the gcc man page, it says the -l
option wraps 'lib' and '.a' around whats specified,
thus looking for the library libmysqlclient.a, which
is a static library, no?  So how come its still
looking for a shared,  .so  library?

Also, when looking in the mysql/lib directory, I see a
libmysqlclient.la file.  What uses this?

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

Thank you very much,

Hans

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
Thread
mysqlclient linking questionHans Zaunere8 Dec
  • mysqlclient linking questionMichael Widenius10 Dec
  • Re: mysqlclient linking questionSinisa Milivojevic10 Dec