【发布时间】:2020-09-10 19:11:30
【问题描述】:
我想为我的程序编译,我被困在这里,我正在使用 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 #
【问题讨论】:
-
你确定
mysqlclient可以在/usr/local/lib/mysq找到吗? -
是的,而且我在 /usr/src/Sursa/Server/extern/mysql/lib 上有它
-
A
.a库适用于 Windows(Mingw 使用它)。 Linux 中的库是.so -
我怎样才能为 Freebsd 12.1 制作 .so?
标签: c++ c++11 gcc shared-libraries freebsd