0
The program is not complete yet, but should at least run the função1
.
The following error is occurring:
/tmp/ccbRtCar.o: na função `funcao1': iniciosimulado02.c:(.text+0x18f): referência indefinida para `pow' collect2: error: ld returned 1 exit status
Follow the program:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
int x = 1;
imprimemenu();
questao03(x);
return (0);
}
int imprimemenu() {
printf("\n(1) funcao 1\n");
printf("\n(2) funcao 2\n");
printf("\n(3) funcao 3\n");
printf("\n(0) sair \n");
return (0);
}
int questao03(int x) {
int y;
int z, a;
while (x != 3) {
printf("Escolha a opcao do menu: \n");
scanf("%i", &x);
switch (x) {
case 1:
printf("Digite o numeros do qual será extraída a raiz: \n");
scanf("%i", &y);
printf("Digite a ordem da raiz: \n");
scanf("%i", &z);
funcao1(y, z);
printf("O resultado da conta deu: %i \n", a);
break;
case 2:
printf("essa funcao nao retorna \n");
break;
case 3:
printf("essa funcao nao retorna \n");
break;
default:
printf("valores entre 0 e 3\n");
}
}
}
int funcao1(int y, int z) {
int k;
k = pow(y, 1 / z);
return (k);
}
I could not understand very well the error and, consequently, I could not find the place of error.
Luke, why are you undoing the issues? They are intended to make the question more legible.
– user28595
I don’t mean to,!
– Lucas Gonçalves
You can help me in my mistake?
– Lucas Gonçalves
How are you compiling?
– Pablo Almeida
gcc filename. c -the filename.exe
– Lucas Gonçalves