简体   繁体   English

警告:函数“ crypt_r”的隐式声明

[英]warning : implicit declaration of function ' crypt_r'

I am trying to write a multi-threaded program in which I need to call the function crypt. 我试图编写一个多线程程序,在其中我需要调用函数crypt。 But the compiler throws this warning. 但是编译器会发出此警告。 Also it doesn't recognize crypt_data as well. 而且它也不能识别crypt_data。 Any ideas? 有任何想法吗?

You need to include appropriate header file. 您需要包括适当的头文件。 In this case crypt.h 在这种情况下crypt.h

 #include <crypt.h>

声明函数crypt的原型(转发声明)或包括具有该原型的标头。

Pre-process the source of your program, eg by running gcc -E in place of gcc -c . 对程序源进行预处理,例如通过运行gcc -E代替gcc -c Look at the output to see if some/all/none of the crypt functions you expect are appearing in the declarations. 查看输出以查看声明中是否出现了您期望的某些/全部/无一的crypt函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM