Undefined reference to '_crypt' error

Posted by Theheahi on Fri 02 May 2008 06:00 PM — 9 posts, 29,073 views.

#0
hi again, in other thread i couldn't solve my problem so im making a new thread about my question.when i try to compile smaug 1.8b i get same error

build.c:1822:Undefined reference to '_crypt' error

however i search and tried everything which i found on that forum still same error. please help.
Australia Forum Administrator #1
I downloaded smaug1.8b.tgz and compiled it under Cygwin. I had to make two changes to make it work:

Change the start of the Makefile to read:


CC      = gcc
#PROF    = -p
NOCRYPT = -DNOCRYPT

# Uncomment the two lines below if compiling on a Solaris box
#SOLARIS_FLAG = -Dsun -DSYSV
#SOLARIS_LINK = -lnsl -lsocket



Note the change to the 3rd line.

Now if you compile you will get an error about missing _re_exec. Edit the file act_comm.c and at the very end change the is_profane function to be:


int is_profane (char *what)
{
 return(0);
}


Now it should compile and link OK.
Amended on Fri 02 May 2008 09:27 PM by Nick Gammon
#2
can you upload your edited version please, cause i try to fix but counl't.
#3
aha, ok now i can commpile thanks for help.
Amended on Fri 02 May 2008 11:16 PM by Theheahi
USA #4
What was the problem? Sharing will help future people solve this if they get the same issue.
#5
just do what nick did, it solves _crypt and _re_exec error while compiling.
USA #6
I thought that is exactly what we already said to do several times in previous threads... :P You said you'd done it but it didn't work, do you know what was different this time?
Australia Forum Administrator #7
Previously he said he had: "uncomment NEED_CRYPT = -lcrypt".

This is different. The Makefile does not actually say what to do with the "NOCRYPT" line. It originally had:


NOCRYPT = 


There were no comments suggesting what to replace that with.

The "NEED_CRYPT = -lcrypt" change solves a linking problem, the other changes solve a compiling problem.

I am pretty sure this is covered in the forum here previously, but in our replies to him we didn't mention that.
Amended on Sat 03 May 2008 01:51 AM by Nick Gammon
#8
yes, as nick told all the times before we only try to uncomment but there was an empty line

NOCRYPT =

add end of that line "-DNOCRYPT"

NOCRYPT = -DNOCRYPT

is the right one, and works fine.