我试图编译我的游戏程序,它给我这个
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 #
这是我的库的Makefile路径
# mysql
INCDIR += -I../../../extern/mysql
LIBDIR += -L/usr/local/lib/mysq
LIBS += -lmysqlclient -lz -pthread -lm -lssl -lcrypto
### END
你需要更新你的 GCC
编译器 C++14的一些特点 gcc4.9不支持。
你可以在FreeBSD中搜索可用的软件包,使用
pkg search <package_name>
和安装任何你想通过
pkg install <package_name>
注意:如果你的当前用户不是sudo,你可能需要在这些命令前加上 root
最后,如果你有问题,如
Fatal error : "some_file"."some_extension" file not found
您可以通过上述命令搜索包名并安装,以便成功编译。
例如,为了减少以下错误
fatal error: 'boost/intrusive_ptr.hpp' file not found
您可以安装 boost-libs
包。