id returned 1 exit status C code, help

-5

My code is giving error id returned 1 and I have not the slightest idea why this is giving this error I did everything right, could anyone help me?

  #include <stdio.h>
  #include <stdlib.h>

  int main ()
  {
    float CP,LP,PP,LA,AA,PL,PC,FP,AT,QA,AAZ;
    Printf ("\nApresente o comprimento,Largura e profundidade: ");
    scanf ("%f, %f, %f", &CP, &LP, &PP);
    printf ("\napresente largura e altura do azulejo: ");
    scanf ("%f, %f", &LA, &AA);
    {
        PL = 2*CP*PP;
        PC = 2*LP*PP;
        FP = CP*LP;
        AT = PL+PC+FP;
        AAZ = LA*AA;
    }
    {
        QA = (AT / AAZ)*1.05;
    }
      printf("\nA quantidade de azulejos para o revestimento da piscina e: %f", QA);
     system ("PAUSE");
  }
    
asked by anonymous 27.04.2014 / 20:30

1 answer

3

I have compiled your code on my machine and the error message is quite clear:

/tmp/ccaHCVvZ.o: In function 'main':
a.c:(.text+0x13): undefined reference to 'Printf'
collect2: error: ld returned 1 exit status

It can not find a definition for the Printf function. You want printf , do not you?

Enabling warnings with the build flag -Wall (always use) the error gets even better:

a.c: In function ‘main’:
a.c:7:5: warning: implicit declaration of function ‘Printf’ [-Wimplicit-function-declaration]
     Printf ("\nApresente o comprimento,Largura e profundidade: ");
     ^
a.c:23:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
/tmp/ccJtM9Fv.o: In function 'main':
a.c:(.text+0x13): undefined reference to 'Printf'
collect2: error: ld returned 1 exit status

Here is pointed out (literally) the function that does not exist. Also a second alert is accused: you set the main function to return int , but it is not returning anything! Add a return 0; at the end.

    
27.04.2014 / 21:29