Page 1 of 1

Compiling with MINGW

Posted: Sat Sep 22, 2012 10:02 pm
by renatov
I'm trying to compile a source code with MINGW, with the options that UVA uses:

Code: Select all

gcc FILE.c -o FILE.exe -lm -lcrypt -O2 -pipe -ansi -DONLINE_JUDGE
But I receive this error:

Code: Select all

(...) ld.exe: cannot find -lcrypt
collect2: ld returned 1 exit status
Does someone know what does this mean and how to fix it?

Re: Compiling with MINGW

Posted: Tue Sep 25, 2012 1:48 am
by brianfry713
Do you need the crypt library? If not don't use -lcrypt.

Re: Compiling with MINGW

Posted: Thu Sep 27, 2012 8:36 am
by renatov
brianfry713 wrote:Do you need the crypt library? If not don't use -lcrypt.
I don't know if I do... what is it for?

Re: Compiling with MINGW

Posted: Thu Sep 27, 2012 10:50 pm
by brianfry713

Re: Compiling with MINGW

Posted: Fri Sep 28, 2012 8:46 am
by renatov
I guess I don't need it then, for now. But what if I need this one day? Is there a way to implement it in Mingw?

Re: Compiling with MINGW

Posted: Fri Sep 28, 2012 8:23 pm
by brianfry713
Cygwin is another option.

Re: Compiling with MINGW

Posted: Fri Sep 28, 2012 9:58 pm
by renatov
brianfry713 wrote:Cygwin is another option.
Thanks, but Cygwin has the same error about lcrypt.

Re: Compiling with MINGW

Posted: Mon Oct 01, 2012 11:29 pm
by brianfry713
http://cygwin.com/packages/
Try installing crypt and ccrypt, or just worry about it when you need it, or try UNIX or LINUX.

Re: Compiling with MINGW

Posted: Tue Oct 02, 2012 1:39 am
by renatov
I compiled it under Debian Linux and it worked just fine, thanks. But when I'm in Windows, I might use Mingw. If I need lcrypt in the future, I'll try to install it.