簡體   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