Compiling with MINGW

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
renatov
New poster
Posts: 20
Joined: Fri Sep 21, 2012 6:33 am

Compiling with MINGW

Post 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?
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Compiling with MINGW

Post by brianfry713 »

Do you need the crypt library? If not don't use -lcrypt.
Check input and AC output for thousands of problems on uDebug!
renatov
New poster
Posts: 20
Joined: Fri Sep 21, 2012 6:33 am

Re: Compiling with MINGW

Post 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?
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Compiling with MINGW

Post by brianfry713 »

Check input and AC output for thousands of problems on uDebug!
renatov
New poster
Posts: 20
Joined: Fri Sep 21, 2012 6:33 am

Re: Compiling with MINGW

Post 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?
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Compiling with MINGW

Post by brianfry713 »

Cygwin is another option.
Check input and AC output for thousands of problems on uDebug!
renatov
New poster
Posts: 20
Joined: Fri Sep 21, 2012 6:33 am

Re: Compiling with MINGW

Post by renatov »

brianfry713 wrote:Cygwin is another option.
Thanks, but Cygwin has the same error about lcrypt.
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Compiling with MINGW

Post 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.
Check input and AC output for thousands of problems on uDebug!
renatov
New poster
Posts: 20
Joined: Fri Sep 21, 2012 6:33 am

Re: Compiling with MINGW

Post 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.
Post Reply

Return to “C”