Dev C++ 'Permission Denied' error on compilation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbderby
    New Member
    • Oct 2007
    • 4

    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.
    [code=c]
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>


    int main()
    {

    int x= 0; // declaration des variables et leur donne une valeur de depart "0"
    int bande1 = 0; // declaration des variables et leur donne une valeur de depart "0"
    int bande2 = 0; // declaration des variables et leur donne une valeur de depart "0"
    int bande3 = 0; // declaration des variables et leur donne une valeur de depart "0"
    float vresistance = 0; // declaration des variables et leur donne une valeur de depart "0"
    float vresistance2 = 0; // declaration des variables et leur donne une valeur de depart "0"


    do{

    printf("\n Voici le tableau des couleurs des bandes, chaque couleur est associe a un numero");
    printf("Si tu veut quitter le programme tape (-1) pour la valeur de n'importe bande\n\n");
    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");

    printf("Quelle est la valeur de la premiere bande de couleur \n");
    scanf("%d",& bande1);

    while(bande1 > 9 && bande1 < -1){

    if(bande1 == -1) {
    system("PAUSE") ;
    return(0); }

    else {
    printf("mauvais e entree , quelle est la valeur de la premiere bande de couleur \n");
    scanf("%d",& bande1);}

    }





    printf("Quelle est la valeur de la deuxieme bande de couleur \n");
    scanf("%d",&ban de2);

    while(bande2 > 9 && bande2 < -1){

    if(bande2 == -1) {
    system("PAUSE") ;
    return(0); }

    else {
    printf("mauvais e entree , quelle est la valeur de la deuxieme bande de couleur \n");
    scanf("%d",& bande2);}
    }


    printf("Quelle est la valeur de la troisieme bande de couleur \n");
    scanf("%d",&ban de3);

    while(bande3 > 9 && bande3 < -1){

    if(bande3 == -1) {
    system("PAUSE") ;
    return(0); }

    else {
    printf("mauvais e entree , quelle est la valeur de la troisieme bande de couleur \n");
    scanf("%d",& bande3); }

    }

    vresistance = ((bande1*10)+(b ande2))* pow(10,bande3);

    printf("%d",vre sistance);
    if(vresistance >= 1000){
    vresistance2 = vresistance /1000;
    printf("la valeur de la resistance(kilo-ohms) est : %f \n", vresistance2);
    }
    else {
    printf("la valeur de la resistance (ohms) est : %f \n", vresistance);
    }
    }while(x == 0);

    system("PAUSE") ;
    return 0;


    }[/code]
    Last edited by sicarie; Oct 3 '07, 01:03 PM. Reason: Code tags
  • ruskalym
    New Member
    • Sep 2007
    • 65

    #2
    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...

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      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.

      Comment

      • cbderby
        New Member
        • Oct 2007
        • 4

        #4
        Originally posted by ruskalym
        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

        Comment

        • Ganon11
          Recognized Expert Specialist
          • Oct 2006
          • 3651

          #5
          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.

          Comment

          • Ganon11
            Recognized Expert Specialist
            • Oct 2006
            • 3651

            #6
            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?

            Comment

            • cbderby
              New Member
              • Oct 2007
              • 4

              #7
              I never change it, because i want the loop to repeat forever, the only way they can exit the program is by typing -1.

              Comment

              • ruskalym
                New Member
                • Sep 2007
                • 65

                #8
                Open properties window of C:\Dev-Cpp\ and try to recursively remove read-only restrictions if it is defined for this folder.

                Comment

                • cbderby
                  New Member
                  • Oct 2007
                  • 4

                  #9
                  Thx alot it works now :)

                  Comment

                  • Pedro Vidal

                    #10
                    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

                    Comment

                    • Icyhot
                      New Member
                      • Oct 2012
                      • 6

                      #11
                      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:
                      Code:
                      int c; 
                      cout << "Press ENTER to continue.";
                      fflush (stdout);
                      do
                      {
                           c = getchar();
                      } while ((c != '\n') && (c != EOF));
                      I'm no expert, but system() is a habit you will eventually break.
                      Last edited by Icyhot; Oct 9 '12, 08:22 AM. Reason: syntax

                      Comment

                      • Kingstan
                        New Member
                        • Jun 2014
                        • 1

                        #12
                        Thanks it works. But how? what happen when we unclick read only symbol. what the reason explain.

                        Comment

                        Working...