0
I’ve done a lot of research and I think I’ve found a solution to your problem.
According to this website when you use a compiler ISO C
, it is necessary to declare the prototype of the function. I believe that this is your case.
So, according to the same, you’d have to do it like this:
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>
//Declaração do protótipo da função
char *crypt(const char *, const char *);
int main(void)
{
char *key = "rdf";
char *salt = "50";
char *hash = crypt(key, salt);
printf("%s\n", hash);
}
This error is not of compilation, it is of linkage (yes, it seems pedanticism, but it is good to know the difference, has several answers here about linkediting and the final assembly process of the executable). Some
-lmylib
is missing apparently. I’m not used to working withunistd.h
– Jefferson Quesado