skyel
skyel

Reputation: 763

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. But the compiler throws this warning. Also it doesn't recognize crypt_data as well. Any ideas?

Upvotes: 1

Views: 1459

Answers (3)

John Zwinck
John Zwinck

Reputation: 249093

Pre-process the source of your program, e.g. by running gcc -E in place of gcc -c. Look at the output to see if some/all/none of the crypt functions you expect are appearing in the declarations.

Upvotes: 1

Anycorn
Anycorn

Reputation: 51435

You need to include appropriate header file. In this case crypt.h

 #include <crypt.h>

Upvotes: 3

P.P
P.P

Reputation: 121347

Declare the prototype for the function crypt (Forward declaration) Or include the header which has that.

Upvotes: 1

Related Questions