我想为我的程序进行编译,我被困在这里,我使用的是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 #
答案 0 :(得分:0)
您在LIBDIR += -L/usr/local/lib/mysq
中有一个错字-缺少l
。
确保已安装mysql57-client
软件包。如果没有,请运行pkg install mysql57-client
。
另外,/usr/src
目录通常用于存储FreeBSD源代码。用它来存储您自己的代码不是一个好主意。