Link Problem
Hi everyone,
I dont know if this is the right place to ask this question. but this is the only place like this I am registed with and I use linux so I thought I would give it a go. I am trying to link libmysqlclient.so to my C program but don't know how. It can not find the library file $ ld -llibmysqlclient.so ld: cannot find -llibmysqlclient.so $ ld -l/usr/lib/libmysqlclient.so ld: cannot find -l/usr/lib/libmysqlclient.so I am using Anjuta as my IDE, but at the monment I just want to know how to find the libraries. I am a working programmer but Windows Borland C++, moving all the code over to Linux as the licences are cheaper for the company Please let me know if you need more information. Thanks |
By the way, I do have mysql installed and the .h and .so files are there
|
If YOU don't know where the library file is, then you can use locate or find to find it on your system:
locate uses a database that is updated regularly (once every day, or so). Just type: locate libmysqlclient.so But if you have recently added the file, or if you don't trust the database, then you could use find: find / -name 'libmysqlclient.so' This will probably take a while. Possibly long enough to go get another cup of tea. :) When you have found your library, use flag -L with ld to include the path to your library in ld's search path. Regards Martin |
May not be of use to you as I don't use ld directly but when I'm using gcc to compile I have amongst other options:
first one is an eye, I -I/pathto/mysql/include/directory -L/pathto/mysql/Lib/directory -lmysqlclient Don't know much about it really, only be using it to brush up on my C whilst doing something practical. |
Thanks guys prob solved.
|
All times are GMT -5. The time now is 03:27 AM. |