# Linux gcc编译error:"collect2: ld returned 1 exit status"

bmeta_info.cpp:4280: undefined reference to crypt’
collect2: ld returned 1 exit status

Undefined reference to 错误:这类错误是在连接过程中出现的，可能有两种原因∶一是使用者自己定义的函数或者全局变量所在源代码文件，没有被编译、连接，或者干脆还没有定义，这 需要使用者根据实际情况修改源程序，给出全局变量或者函数的定义体；二是未定义的符号是一个标准的库函数，在源程序中使用了该库函数，而连接过程中还没有 给定相应的函数库的名称，或者是该档案库的目录名称有问题

GNU EXTENSION
The glibc2 version of this function has the following additional features.  If salt is a character string starting with the three characters "$1$" followed by at most eight characters, and optionally terminated by "$", then instead of using the DES machine, the glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely "$1$<string>$", where "<string>" stands for the up to 8 characters following "$1$" in the salt, followed by 22 bytes chosen from the set [a–zA–Z0–9./].  The entire key is significant here (instead of only the first 8 bytes).
Programs using this function must be linked with -lcrypt.`

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客