如何避免这些编译错误?

时间:2018-12-01 16:26:05

标签: c plugins compiler-errors

我正在尝试为我的游戏服务器编译一个插件(更确切地说是click)。 因此,当我尝试通过make命令行在Linux VM(使用centos 7+)中编译插件时,出现以下错误:

Compiling plugin..
Compiling plugin SDK..
Linking (dynamic)..
/usr/bin/ld: cannot find -lmysqlclient_r
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_thread.a when searching for -lboost_thread
/usr/bin/ld: cannot find -lboost_thread
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_chrono.a when searching for -lboost_chrono
/usr/bin/ld: cannot find -lboost_chrono
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_date_time.a when searching for -lboost_date_time
/usr/bin/ld: cannot find -lboost_date_time
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_system.a when searching for -lboost_system
/usr/bin/ld: cannot find -lboost_system
/usr/bin/ld: skipping incompatible //usr/local/lib/libboost_atomic.a when searching for -lboost_atomic
/usr/bin/ld: cannot find -lboost_atomic
collect2: error: ld returned 1 exit status
make: *** [dynamic_link] Error 1

我的问题是如何避免这些错误? 重要说明:用于编译此插件的教程(在github主页上针对此插件)适用于该插件的较新版本,但我需要R37。 该插件使用C语言编写,并且内部有一个makefile。 谢谢。

2 个答案:

答案 0 :(得分:0)

安装发行版随附的libboost。 /usr/local/lib中的所有内容都是不好的。

答案 1 :(得分:0)

Makefile出于某些原因使用-m32编译选项会导致生成32位可执行文件。因此,此可执行文件将需要32位库。因此,您应该删除-m32选项或安装所需的32位依赖项。