This is my job. Give me an error when I call the main function.
This is the header of my function, in the file function1.h
int eleminar_numeros_repetidos(int *vec, int n, int *vec1);
File function1.c:
void organizar_vetor(int *vec, int n){
int i,j;
for(i=0 ; i <n-1; i=i+1)
{
for(j=i+1 ; j<n ; j=j+1)
{
if (*(vec +i) >*(vec+j))
{
int aux =*(vec+i);
*(vec+i)=*(vec+j);
*(vec+j)=aux;
}
}
}
}
int eleminar_numeros_repetidos(int *vec, int n, int *vec1){
organizar_vetor(vec,n);
int i,j;
for(i=0 ; i <n-1; i++)
{
for(j=i+1 ; j<n ; j++)
{
vec[i]=vec1[i];
if (vec1[i] == vec1[j])
{
int k;
for (k = j; k <n-1 ; k++)
{
vec1[k]=vec1[k+1];
j--;n--;
}
}
}
}
return n;
}
Error:
gcc ex09.c
/tmp/ccYQaeVL.o: In function 'main':
ex09.c:(.text+0x112): undefined reference to 'eleminar_numeros_repetidos'
collect2: error: ld returned 1 exit status
make: *** [ex09.o] Error 1