Tag: 链接器 错误

对“crypt”的未定义引用

我正在使用下面的代码,我在网络的某个地方找到了,当我尝试构建它时,我收到了一个错误。 编译没问题。 这是错误: /tmp/ccCnp11F.o: In function `main’: crypt.c:(.text+0xf1): undefined reference to `crypt’ collect2: ld returned 1 exit status 这是代码: #include #include #include #include int main() { unsigned long seed[2]; char salt[] = “$1$……..”; const char *const seedchars = “./0123456789ABCDEFGHIJKLMNOPQRST” “UVWXYZabcdefghijklmnopqrstuvwxyz”; char *password; int i; /* Generate a (not very) random seed. You should do it […]