lundi 13 juillet 2020

Using the (antiquated) C crypt() method for homework - the compiler won't link?

all:

I'm supposed to use the crypt( ) function in a homework assignment. It's an old C method, which is probably pretty insecure, but it's just for demonstrative purposes.

The only thing, I can't figure out how to use the dang function. I'm using CLion as my IDE on Ubuntu. It's supposed to be defined in the <crypt.h> or <unistd.h>, but I cannot get this thing to compile. The crypt( ) function has an "undefined reference" error after building the project. I know it's one of those two libraries, though - so what's up? Is there an issue with linking to that library or something? I've read around and come across "use -lcrypt", but I'm not entirely sure what to do with that inside CLion. The only explanations were involving make files; which, didn't apply to me (or they did, and I didn't know how it related). There's not much documentation for it, either, because of how outdated the function is.

Thanks, all.

Aucun commentaire:

Enregistrer un commentaire