Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14232 > unrolled thread

compilation error

Started byBabu <babugirisu@gmail.com>
First post2014-09-16 00:04 -0700
Last post2014-09-16 14:43 +0000
Articles 8 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  compilation error Babu <babugirisu@gmail.com> - 2014-09-16 00:04 -0700
    Re: compilation error Babu <babugirisu@gmail.com> - 2014-09-16 00:06 -0700
      Re: compilation error Markus Grob <snoopy@ilnet.ch> - 2014-09-16 09:57 +0200
        Re: compilation error Babu <babugirisu@gmail.com> - 2014-09-16 01:12 -0700
          Re: compilation error Babu <babugirisu@gmail.com> - 2014-09-16 02:42 -0700
          Re: compilation error Markus Grob <snoopy@ilnet.ch> - 2014-09-16 12:04 +0200
      Re: compilation error Jerry Stuckle <jstucklex@attglobal.net> - 2014-09-16 08:26 -0400
      Re: compilation error Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-16 14:43 +0000

#14232 — compilation error

FromBabu <babugirisu@gmail.com>
Date2014-09-16 00:04 -0700
Subjectcompilation error
Message-ID<eaf080e1-1192-4632-a320-89f9b021e24b@googlegroups.com>
Hello All,

 I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful. 
i have runned "apt-get install libssl-dev" 

[toc] | [next] | [standalone]


#14233

FromBabu <babugirisu@gmail.com>
Date2014-09-16 00:06 -0700
Message-ID<df51d36e-095e-4dbd-a5ea-755de41e25d9@googlegroups.com>
In reply to#14232
On Tuesday, September 16, 2014 12:34:58 PM UTC+5:30, Babu wrote:
> Hello All,
> 
> 
> 
>  I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful. 
> 
> i have runned "apt-get install libssl-dev"

Here is the program :-

#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "aes.h"
 
 
void encrypt(const char *fileIn, const char *fileOut,
    const unsigned char *key);
void decrypt(const char *fileIn, const char *fileOut,
    const unsigned char *key);
 
int main() {
  const unsigned char key[] = "my key";
 
  srand(time(NULL));
 
  aes_init();
  encrypt("main.c", "main.c.encrypted", key);
  decrypt("main.c.encrypted", "main.c.decrypted", key);
 
  return 0;
}
 
void encrypt(const char *fileIn, const char *fileOut, 
    const unsigned char *key) {
  int i;
  aes_encrypt_ctx ctx[1];
  unsigned char iv[16]; /* initialisation vector */
  unsigned char inBuffer[200], outBuffer[200];
  FILE *inFile = fopen(fileIn, "rb");
  FILE *outFile = fopen(fileOut, "wb");
 
  /* pick a random initialisation vector */
  for(i = 0; i < 16; ++i)
    iv[i] = rand() & 0xFF;
  fwrite(iv, 1, 16, outFile);
 
  aes_encrypt_key256(key, ctx);
  while((i = fread(inBuffer, 1, sizeof(inBuffer), inFile)) > 0) {
    aes_ofb_crypt(inBuffer, outBuffer, i, iv, ctx);
    fwrite(outBuffer, 1, i, outFile);
  }
 
  fclose(inFile);
  fclose(outFile);
}
 
void decrypt(const char *fileIn, const char *fileOut, 
    const unsigned char *key) {
  int i;
  aes_encrypt_ctx ctx[1];
  unsigned char iv[16]; /* initialisation vector */
  unsigned char inBuffer[200], outBuffer[200];
  FILE *inFile = fopen(fileIn, "rb");
  FILE *outFile = fopen(fileOut, "wb");
 
  /* read initialization vector from file */
  if(fread(iv, 1, 16, inFile) < 16) {
    fclose(inFile);
    fclose(outFile);
    return; /* error: file doesn't even contain an initialisation vector */
  }
 
  aes_encrypt_key256(key, ctx);
  while((i = fread(inBuffer, 1, sizeof(inBuffer), inFile)) > 0) {
    aes_ofb_crypt(inBuffer, outBuffer, i, iv, ctx);
    fwrite(outBuffer, 1, i, outFile);
  }
 
  fclose(inFile);
  fclose(outFile);
}

[toc] | [prev] | [next] | [standalone]


#14234

FromMarkus Grob <snoopy@ilnet.ch>
Date2014-09-16 09:57 +0200
Message-ID<lv8qhl$2qe$1@dont-email.me>
In reply to#14233
Babu schrieb:
> On Tuesday, September 16, 2014 12:34:58 PM UTC+5:30, Babu wrote:
>> Hello All,
>>
>>
>>
>>   I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful.
>>
>> i have runned "apt-get install libssl-dev"

What is exactly the compilation error?
>
> Here is the program :-
>
> #include <stdlib.h>
> #include <time.h>
> #include <stdio.h>
> #include "aes.h"

is the aes.h file in your path? I think, this throws your error.

What name have you gives for the aes? aes.c?

Sincerely, Markus

[toc] | [prev] | [next] | [standalone]


#14235

FromBabu <babugirisu@gmail.com>
Date2014-09-16 01:12 -0700
Message-ID<8c88051e-bb99-4ecd-bf9f-5965e59a98cc@googlegroups.com>
In reply to#14234
On Tuesday, September 16, 2014 1:27:48 PM UTC+5:30, Markus Grob wrote:
> Babu schrieb:
> 
> > On Tuesday, September 16, 2014 12:34:58 PM UTC+5:30, Babu wrote:
> 
> >> Hello All,
> 
> >>
> 
> >>
> 
> >>
> 
> >>   I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful.
> 
> >>
> 
> >> i have runned "apt-get install libssl-dev"
> 
> 
> 
> What is exactly the compilation error?
> 
> >
> 
> > Here is the program :-
> 
> >
> 
> > #include <stdlib.h>
> 
> > #include <time.h>
> 
> > #include <stdio.h>
> 
> > #include "aes.h"
> 
> 
> 
> is the aes.h file in your path? I think, this throws your error.
> 
> 
> 
> What name have you gives for the aes? aes.c?
> 
> 
> 
> Sincerely, Markus
Exactly , that throws as "compilation error".. "no such file or directory ". 
Actually , i am  not clear of this weather it requires path or not .
I have given file name as aes.c.this is what i am getting..

root@mymo-HP-Compaq-dc7700-Small-Form-Factor:/home/mymo/Desktop/mac# cc aes256.c -o aes256
aes256.c:4:17: fatal error: aes.h: No such file or directory
 #include "aes.h"
                 ^
compilation terminated.

[toc] | [prev] | [next] | [standalone]


#14236

FromBabu <babugirisu@gmail.com>
Date2014-09-16 02:42 -0700
Message-ID<e5cc7a22-18e3-4b3f-8bfb-ceeb3c7618b0@googlegroups.com>
In reply to#14235
Hello Markus,

as you said this is compilation terminated..can you tell me what could be done to fix this...

[toc] | [prev] | [next] | [standalone]


#14237

FromMarkus Grob <snoopy@ilnet.ch>
Date2014-09-16 12:04 +0200
Message-ID<lv91uq$jcm$1@dont-email.me>
In reply to#14235
Babu schrieb:
> On Tuesday, September 16, 2014 1:27:48 PM UTC+5:30, Markus Grob wrote:
>> Babu schrieb:
>>
>>> On Tuesday, September 16, 2014 12:34:58 PM UTC+5:30, Babu wrote:
>>
>>>> Hello All,
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>>    I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful.
>>
>>>>
>>
>>>> i have runned "apt-get install libssl-dev"
>>
>>
>>
>> What is exactly the compilation error?
>>
>>>
>>
>>> Here is the program :-
>>
>>>
>>
>>> #include <stdlib.h>
>>
>>> #include <time.h>
>>
>>> #include <stdio.h>
>>
>>> #include "aes.h"
>>
>>
>>
>> is the aes.h file in your path? I think, this throws your error.
>>
>>
>>
>> What name have you gives for the aes? aes.c?
>>
>>
>>
>> Sincerely, Markus
> Exactly , that throws as "compilation error".. "no such file or directory ".
> Actually , i am  not clear of this weather it requires path or not .
> I have given file name as aes.c.this is what i am getting..
>
> root@mymo-HP-Compaq-dc7700-Small-Form-Factor:/home/mymo/Desktop/mac# cc aes256.c -o aes256
> aes256.c:4:17: fatal error: aes.h: No such file or directory
>   #include "aes.h"

It needs the header file to compile. Have you downloaded this file? If 
so, you have to download the header file too and put it in the directory 
where aes.c is, so it could be found. The feader file is needed, because 
it holds the definitions of the file.

It could also be written for yourself. I can't give it to you, but it 
has to be easy to dine it, because the file you have is very short.

Sincerely, Markus

[toc] | [prev] | [next] | [standalone]


#14238

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-09-16 08:26 -0400
Message-ID<lv9a8v$bav$1@dont-email.me>
In reply to#14233
On 9/16/2014 3:06 AM, Babu wrote:
> On Tuesday, September 16, 2014 12:34:58 PM UTC+5:30, Babu wrote:
>> Hello All,
>>
>>
>>
>>  I am running the aes256 program on ubuntu 12.04 , while compilation getting error, don't know weather header file is missing or what actually it requires to feed. can anyone help me out of this error that really makes helpful. 
>>
>> i have runned "apt-get install libssl-dev"
> 
> Here is the program :-
> 
> #include <stdlib.h>
> #include <time.h>
> #include <stdio.h>
> #include "aes.h"
>  
>  
> void encrypt(const char *fileIn, const char *fileOut,
>     const unsigned char *key);
> void decrypt(const char *fileIn, const char *fileOut,
>     const unsigned char *key);
>  
> int main() {
>   const unsigned char key[] = "my key";
>  
>   srand(time(NULL));
>  
>   aes_init();
>   encrypt("main.c", "main.c.encrypted", key);
>   decrypt("main.c.encrypted", "main.c.decrypted", key);
>  
>   return 0;
> }
>  
> void encrypt(const char *fileIn, const char *fileOut, 
>     const unsigned char *key) {
>   int i;
>   aes_encrypt_ctx ctx[1];
>   unsigned char iv[16]; /* initialisation vector */
>   unsigned char inBuffer[200], outBuffer[200];
>   FILE *inFile = fopen(fileIn, "rb");
>   FILE *outFile = fopen(fileOut, "wb");
>  
>   /* pick a random initialisation vector */
>   for(i = 0; i < 16; ++i)
>     iv[i] = rand() & 0xFF;
>   fwrite(iv, 1, 16, outFile);
>  
>   aes_encrypt_key256(key, ctx);
>   while((i = fread(inBuffer, 1, sizeof(inBuffer), inFile)) > 0) {
>     aes_ofb_crypt(inBuffer, outBuffer, i, iv, ctx);
>     fwrite(outBuffer, 1, i, outFile);
>   }
>  
>   fclose(inFile);
>   fclose(outFile);
> }
>  
> void decrypt(const char *fileIn, const char *fileOut, 
>     const unsigned char *key) {
>   int i;
>   aes_encrypt_ctx ctx[1];
>   unsigned char iv[16]; /* initialisation vector */
>   unsigned char inBuffer[200], outBuffer[200];
>   FILE *inFile = fopen(fileIn, "rb");
>   FILE *outFile = fopen(fileOut, "wb");
>  
>   /* read initialization vector from file */
>   if(fread(iv, 1, 16, inFile) < 16) {
>     fclose(inFile);
>     fclose(outFile);
>     return; /* error: file doesn't even contain an initialisation vector */
>   }
>  
>   aes_encrypt_key256(key, ctx);
>   while((i = fread(inBuffer, 1, sizeof(inBuffer), inFile)) > 0) {
>     aes_ofb_crypt(inBuffer, outBuffer, i, iv, ctx);
>     fwrite(outBuffer, 1, i, outFile);
>   }
>  
>   fclose(inFile);
>   fclose(outFile);
> }
> 

Try asking in a C newsgroup.  This one is for PHP - hence the "PHP" in
its name.

When you ask in the correct place, you get better answers.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14239

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-09-16 14:43 +0000
Message-ID<lv9iae$7fp$1@dont-email.me>
In reply to#14233
On Tue, 16 Sep 2014 00:06:05 -0700, Babu wrote:

> Here is the program :-
> 
> #include <stdlib.h>

Looks like c, not PHP. Try a c programming newsgroup.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web