Unix/Linux Go Back    


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

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

Programming


Tags
c programming language, solved

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 10-26-2015   -   Original Discussion by Shre
Shre's Unix or Linux Image
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 09:47 AM.. Reason: code tags
Sponsored Links
    #2  
Old Unix and Linux 10-26-2015   -   Original Discussion by Shre
zaxxon's Unix or Linux Image
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 5 December 2017, 7:45 AM EST
Location: St. Gallen, Switzerland
Posts: 6,573
Thanks: 176
Thanked 560 Times in 481 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 Unix and Linux 10-26-2015   -   Original Discussion by Shre
Shre's Unix or Linux Image
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 Unix and Linux 10-26-2015   -   Original Discussion by Shre
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 14 December 2017, 4:58 PM EST
Location: Saskatchewan
Posts: 22,547
Thanks: 1,159
Thanked 4,287 Times in 3,955 Posts
*shrug* All right, you're wrong. Linux 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 Unix and Linux 10-26-2015   -   Original Discussion by Shre
Shre's Unix or Linux Image
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
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 05:55 AM
fatal error: stdio.h: No such file or directory Fingerz Solaris 2 10-22-2012 04: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 03:51 PM
fatal: cannot open file `TNAME' for reading (No such file or directory) kunwar Shell Programming and Scripting 1 03-11-2011 08: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 06:52 AM



All times are GMT -4. The time now is 08:06 AM.