undefined reference to `crypt'

后端 未结 4 1073
既然无缘
既然无缘 2021-01-12 08:27

I am using the below code that i found somewhere in the net and i am getting an error when i try to build it. The compilation is ok.

Here is the error:



        
4条回答
  •  孤街浪徒
    2021-01-12 08:36

    You've to add -lcrypt when compiling... Imagine the source file is called crypttest.c, you'll do:

    cc -lcrypt -o crypttest crypttest.c
    

提交回复
热议问题