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 » Sat Sep 22, 2012 10:02 pm

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 » Tue Sep 25, 2012 1:48 am

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 » Thu Sep 27, 2012 8:36 am

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 » Thu Sep 27, 2012 10:50 pm

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 » Fri Sep 28, 2012 8:46 am

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 » Fri Sep 28, 2012 8:23 pm

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 » Fri Sep 28, 2012 9:58 pm

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 » Mon Oct 01, 2012 11:29 pm

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 » Tue Oct 02, 2012 1:39 am

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”