473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dev C++ 'Permission Denied' error on compilation

''permission denied''
''id returned 1 exit status''

im compiling with dev c++ 4.9.9.2
im using windows vista, but i have compiled and ran other programs before.

pretty simple program, some parts in french, just wondering what i have to do fix it.
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5.  
  6. int main()
  7. {
  8.  
  9. int x= 0;                           // declaration des variables et leur donne une valeur de depart "0"
  10. int bande1 = 0;                     // declaration des variables et leur donne une valeur de depart "0"
  11. int bande2 = 0;                     // declaration des variables et leur donne une valeur de depart "0"
  12. int bande3 = 0;                     // declaration des variables et leur donne une valeur de depart "0"
  13. float vresistance = 0;              // declaration des variables et leur donne une valeur de depart "0"
  14. float vresistance2 = 0;             // declaration des variables et leur donne une valeur de depart "0"
  15.  
  16.  
  17. do{
  18.  
  19. printf("\n Voici le tableau des couleurs des bandes, chaque couleur est associe a un numero");
  20. printf("Si tu veut quitter le programme tape (-1) pour la valeur de n'importe bande\n\n");
  21. printf("0-Noir \n" "1-Brun \n" "2-Rouge \n" "3-Orange \n" "4-Jaune \n" "5-Vert \n" "6-Bleu \n" "7-Violet \n" "8-Gris \n" "9-Blanc \n\n\n");
  22.  
  23. printf("Quelle est la valeur de la premiere bande de couleur \n");
  24. scanf("%d",& bande1);
  25.  
  26. while(bande1 > 9 && bande1 < -1){
  27.  
  28.                     if(bande1 == -1)     {
  29.                     system("PAUSE");
  30.                     return(0);           }
  31.  
  32.                     else                 {
  33.                     printf("mauvaise entree , quelle est la valeur de la premiere bande de couleur \n");     
  34.                     scanf("%d",& bande1);}
  35.  
  36.                                 } 
  37.  
  38.  
  39.  
  40.  
  41.  
  42. printf("Quelle est la valeur de la deuxieme bande de couleur \n");
  43. scanf("%d",&bande2);
  44.  
  45. while(bande2 > 9 && bande2 < -1){
  46.  
  47.                     if(bande2 == -1)     {
  48.                     system("PAUSE");
  49.                     return(0);           }
  50.  
  51.                     else                 {
  52.                     printf("mauvaise entree , quelle est la valeur de la deuxieme bande de couleur \n");     
  53.                     scanf("%d",& bande2);}
  54.  
  55.  
  56. printf("Quelle est la valeur de la troisieme bande de couleur \n");
  57. scanf("%d",&bande3);
  58.  
  59. while(bande3 > 9 && bande3 < -1){
  60.  
  61.                     if(bande3 == -1)      {
  62.                     system("PAUSE");
  63.                     return(0);            }
  64.  
  65.                     else                  {
  66.                     printf("mauvaise entree , quelle est la valeur de la troisieme bande de couleur \n");     
  67.                     scanf("%d",& bande3); }
  68.  
  69.                                 }
  70.  
  71. vresistance = ((bande1*10)+(bande2))* pow(10,bande3);
  72.  
  73.             printf("%d",vresistance);
  74.                                      if(vresistance >= 1000){
  75.                                      vresistance2 = vresistance /1000;
  76.                                      printf("la valeur de la resistance(kilo-ohms) est :  %f \n", vresistance2);
  77.                                                              }
  78.                                      else      {
  79.                                      printf("la valeur de la resistance (ohms) est :  %f \n", vresistance);
  80.                                                }
  81. }while(x == 0);
  82.  
  83.       system("PAUSE");
  84.       return 0;
  85.  
  86.  
  87. }
Oct 3 '07 #1
11 29219
What is your working directory?

What path is the target binary in?

The problem may issue from access control restrictions to Program Files directory, thanks to Vista...
Oct 3 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
Are you using a network drive for your project??

Visual Studio uses a keyboard response file to pass values to the compiler on a separate thread. Often, the sysadmins setup the network so that insufficient permissions exist for that thread to open the keyboard response file on the network drive.
Oct 3 '07 #3
What is your working directory?

What path is the target binary in?

The problem may issue from access control restrictions to Program Files directory, thanks to Vista...
C:\Dev-Cpp\Bin

C:\Dev-Cpp\lib
Oct 3 '07 #4
Ganon11
3,652 Expert 2GB
My guess is there's a bad pointer somewhere that you try and use. It's probably pointing to some garbage location in memory, which is protected by your computer.
Oct 3 '07 #5
Ganon11
3,652 Expert 2GB
Also, you assign 0 to x as you initialize it. It's also the controller for your do...while loop. When do you change x's value?
Oct 3 '07 #6
I never change it, because i want the loop to repeat forever, the only way they can exit the program is by typing -1.
Oct 4 '07 #7
Open properties window of C:\Dev-Cpp\ and try to recursively remove read-only restrictions if it is defined for this folder.
Oct 4 '07 #8
Thx alot it works now :)
Oct 4 '07 #9
I found the error!
I found that if there is a file named 'exemplo.c' and an executable 'example.exe', if you delete the text file executable and leaves, when will compile 'exemplo.c' does not work, since there is already a exe in the same directory.

So when you delete delete both. COMPILE AGAIN
Oct 25 '10 #10
Icyhot
6
Why are you using system()!? It is evil! Read here for more information: http://www.cplusplus.com/articles/j3wTURfi/ Also, here is a substitute code snippet I oftentimes use instead:
Expand|Select|Wrap|Line Numbers
  1. int c; 
  2. cout << "Press ENTER to continue.";
  3. fflush (stdout);
  4. do
  5. {
  6.      c = getchar();
  7. } while ((c != '\n') && (c != EOF));
  8.  
I'm no expert, but system() is a habit you will eventually break.
Oct 9 '12 #11
Thanks it works. But how? what happen when we unclick read only symbol. what the reason explain.
Jun 5 '14 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Marc | last post by:
Hello, when using flock() I get a permission denied error: Warning: fopen("<filename>", "r+") - Permission denied in <pathtofile> on line 7 I do this: $fileToOpen=substr($PHP_SELF,...
2
by: PM Creyghton | last post by:
I got this error without using frames: First of all, I'm developing an ASP application, and once in a while my activeX components crash or hang, I got page-not-found errors, errors generated by...
3
by: Colin Graham | last post by:
I am working with a piece of javascript that i have inherited from another developer. It is for a date picker function and it runs fine locally but i get an error when i deploy it on the server and...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
3
by: fniles | last post by:
In our ASP page, we call XMLHttp to download XML files. When calling our page using localhost (localhost/myWebSite/myPage.htm), it works, but when calling using the IP address of the web server...
1
by: nandakumar.raghu | last post by:
Hi, I have written a javascript function that acceses properties from an activex object. - <OBJECT id="alertObj" classid="clsid:AEE77194-B98F-4E0E-A27F-4AD6B23F0038"></OBJECT> function...
6
by: Angel | last post by:
I am using coolmenus 4, frames version by DHTMLcentral.com. When I click on any of the submenus, I get an "Permission Denied" error. There after the menus stop working. The cursor on the menu...
0
by: muthurani | last post by:
hi all, how to resolve the below error, Permission denied error in create object for using excel.application object in asp page. Please help me.i need this now. thanks in advance,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.