×
UNIX.COM Login
Username:
Password:  
Show Password






👤


Programming

Post questions about C, C++, Java, SQL, and other programming languages here.

Fatal error: mcrypt.h: No such file or directory

Tags
c programming language, solved

👤 Login to reply

 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-26-2015
Shre Shre is offline
Registered User
 
Join Date: Oct 2015
Last Activity: 25 November 2015, 5:32 AM EST
Posts: 4
Thanks: 2
Thanked 1 Time in 1 Post
Fatal error: mcrypt.h: No such file or directory

Hi All,

I am trying to include a mcrypt.h header but I am getting the below error:

Code:
test01> gcc test1.c

test1.c:5:20: fatal error: mcrypt.h: No such file or directory
 #include <mcrypt.h>
                    ^
compilation terminated.

As I cannot put my encryption program here, so have put a sample code which I ran :

Code:
/* Hello World program */

#include<stdio.h>

#include <mcrypt.h>


main()
{
    printf("Hello World");

}

libmcrypt is installed as below in UNIX

Code:
lrwxrwxrwx    1 root     system           43 14 Jul 16:29 libmcrypt.so.4.4.8 -> ../../opt/freeware/lib64/libmcrypt.so.4.4.8

lrwxrwxrwx    1 root     system           39 14 Jul 16:29 libmcrypt.so.4 -> ../../opt/freeware/lib64/libmcrypt.so.4

lrwxrwxrwx    1 root     system           37 14 Jul 16:29 libmcrypt.so -> ../../opt/freeware/lib64/libmcrypt.so

lrwxrwxrwx    1 root     system           34 14 Jul 16:29 libmcrypt -> ../../opt/freeware/lib64/libmcrypt

Thanks in ADVANCE.


Moderator's Comments:
Fatal error: mcrypt.h: No such file or directory Use code tags, thanks.

Last edited by zaxxon; 10-26-2015 at 08:47 AM.. Reason: code tags
Sponsored Links
    #2  
Old 10-26-2015
zaxxon's Unix or Linux Image
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 6 July 2018, 8:04 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,574
Thanks: 178
Thanked 569 Times in 483 Posts
You will have to install the package libmcrypt-dev as it provides mcrypt.h.
The Following User Says Thank You to zaxxon For This Useful Post:
Shre (10-26-2015)
Sponsored Links
    #3  
Old 10-26-2015
Shre Shre is offline
Registered User
 
Join Date: Oct 2015
Last Activity: 25 November 2015, 5:32 AM EST
Posts: 4
Thanks: 2
Thanked 1 Time in 1 Post
Hi Zaxxon,

Thank you for your reply.

But as I have mentioned, libmcrypt is already installed :

Code:
lrwxrwxrwx    1 root     system           43 14 Jul 16:29 libmcrypt.so.4.4.8 -> ../../opt/freeware/lib64/libmcrypt.so.4.4.8

lrwxrwxrwx    1 root     system           39 14 Jul 16:29 libmcrypt.so.4 -> ../../opt/freeware/lib64/libmcrypt.so.4

lrwxrwxrwx    1 root     system           37 14 Jul 16:29 libmcrypt.so -> ../../opt/freeware/lib64/libmcrypt.so

lrwxrwxrwx    1 root     system           34 14 Jul 16:29 libmcrypt -> ../../opt/freeware/lib64/libmcrypt

Let me know if I am wrong, as I am new bee in C programming.

Thanks.
    #4  
Old 10-26-2015
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 16 July 2018, 3:49 PM EDT
Location: Saskatchewan
Posts: 22,724
Thanks: 1,192
Thanked 4,349 Times in 4,005 Posts
*shrug* All right, you're wrong. You need to install libmcrypt-dev, too.

Most binary distributions split packages into two parts, those needed to compile with them, and those needed to just use them. I consider this a bad habit inherited from the 90's when hard drive space was at a premium, not really necessary now in most situations.
The Following User Says Thank You to Corona688 For This Useful Post:
Shre (10-26-2015)
Sponsored Links
    #5  
Old 10-26-2015
Shre Shre is offline
Registered User
 
Join Date: Oct 2015
Last Activity: 25 November 2015, 5:32 AM EST
Posts: 4
Thanks: 2
Thanked 1 Time in 1 Post
Thanks Zaxxon and Corona688. It worked.:-)
The Following User Says Thank You to Shre For This Useful Post:
Corona688 (10-26-2015)
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
./curl -V showing fatal: libldap.so.5: open failed: No such file or directory manalisharmabe Solaris 9 08-07-2013 04:55 AM
fatal error: stdio.h: No such file or directory Fingerz Solaris 2 10-22-2012 03:09 PM
help with email to be triggered based on fatal error detection from batch run log file neded zico1986 Shell Programming and Scripting 1 09-06-2011 02:51 PM
fatal: cannot open file `TNAME' for reading (No such file or directory) kunwar Shell Programming and Scripting 1 03-11-2011 07:03 PM
Error- ld.so.1: expr: fatal: libgmp.so.3: open failed:No such file or directory Hari_Ganesh Solaris 2 07-16-2009 05:52 AM



All times are GMT -4. The time now is 12:15 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.