我该如何解决?错误:无法找到库-lmysqlclient

问题描述 投票:0回答:1

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

当前路径

# 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 #
c++ c++11 gcc shared-libraries freebsd
1个回答
0
投票

您在LIBDIR += -L/usr/local/lib/mysq中有错别字-缺少l

确保已安装mysql57-client软件包。如果不是,请运行pkg install mysql57-client

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

© www.soinside.com 2019 - 2024. All rights reserved.