开发者社区> 问答> 正文

关于linux c下链接mysql出现无法找到mysqlclient

我的mysql安装完成之后,没有找到mysqlclient.so文件,只有mysqlclient.a文件,在/usr/lib/mysql文件夹下

这个是makefile文件
screenshot
这个是源文件
screenshot
这个是爆出来的错误
screenshot

展开
收起
小旋风柴进 2016-03-11 10:11:53 2421 0
1 条回答
写回答
取消 提交回答
  • gcc 相关参数说明

    -llibrary

    -l library
    Search the library named library when linking. (The second alternative with
    the library as a separate argument is only for POSIX compliance and is not
    recommended.)
    It makes a difference where in the command you write this option; the linker
    searches and processes libraries and object files in the order they are specified.
    Thus, ‘foo.o -lz bar.o’ searches library ‘z’ after file ‘foo.o’ but before
    ‘bar.o’. If ‘bar.o’ refers to functions in ‘z’, those functions may not be loaded.
    The linker searches a standard list of directories for the library, which is actually
    a file named ‘liblibrary.a’. The linker then uses this file as if it had been
    specified precisely by name.
    The directories searched include several standard system directories plus any
    that you specify with ‘-L’.
    Normally the files found this way are library files—archive files whose members
    are object files. The linker handles an archive file by scanning through it for
    members which define symbols that have so far been referenced but not defined.
    But if the file that is found is an ordinary object file, it is linked in the usual
    fashion. The only difference between using an ‘-l’ option and specifying a file
    name is that ‘-l’ surrounds library with ‘lib’ and ‘.a’ and searches several
    directories.
    2019-07-17 18:58:32
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Alibaba Cloud Linux 3 发布 立即下载
ECS系统指南之Linux系统诊断 立即下载
ECS运维指南 之 Linux系统诊断 立即下载