繁体   English   中英

我该如何解决这个问题? 错误:找不到库 -lmysqlclient

[英]How can I solve this ? error: unable to find library -lmysqlclient

我想为我的程序编译,我被困在这里,我正在使用 freebsd 12.1 和 gcc++6.4 + gnu gmake -j20 命令

当前路径

# mysql
INCDIR += -I../../../extern/mysql
LIBDIR += -L/usr/local/lib/mysq
LIBS   += -lmysqlclient -lz -pthread -lm -lssl -lcrypto
### END

腻子错误

root@vps:/usr/src/Sursa/Server/source/game/src # gmake -j20
linking ../game
ld: error: unable to find library -lmysqlclient
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:228: ../game] Error 1
root@vps:/usr/src/Sursa/Server/source/game/src #
root@vps:/usr/src/Sursa/Server/source/game/src #

我编辑了错字,现在我收到了

root@vps:/usr/src/Sursa/Server/source/game/src # gmake -j20
linking ../game
ld: error: /usr/local/lib/mysql/libmysqlclient.a(client.c.o) is incompatible with elf_i386_fbsd
ld: error: /usr/local/lib/mysql/libmysqlclient.a(libmysql.c.o) is incompatible with elf_i386_fbsd
ld: error: /usr/local/lib/mysql/libmysqlclient.a(crypt_genhash_impl.cc.o) is incompatible with elf_i386_fbsd
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:228: ../game] Error 1
root@vps:/usr/src/Sursa/Server/source/game/src #

您在LIBDIR += -L/usr/local/lib/mysq - missing l中有错字。

确保您已安装mysql57-client package。 如果没有,请运行pkg install mysql57-client

此外, /usr/src目录通常用于存储 FreeBSD 源代码。 使用它来存储您自己的代码并不是一个好主意。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM