D
Daniel Heiserer
hi,
I am sure that is a stupid error of mine, but why the hell
does this not work:
-------------------------------------------
/tmp/ccUN1Hel.o(.text+0x26): undefined reference to `abs(int)'
collect2: ld returned 1 exit status
-------------------------------------------
#include <stdio.h>
int main(){
int abs(int);
for (int jj=10;jj>=-10;jj--){
fprintf(stdout,"%d ===> %d\n",jj,abs(jj));
}
return 0;
}
-------------------------------------------
Manual ABS(3)
NAME
abs, labs, llabs, imaxabs - compute the absolute value of an
integer.
SYNOPSIS
#include <stdlib.h>
int abs(int j);
long int labs(long int j);
long long int llabs(long long int j);
I am sure that is a stupid error of mine, but why the hell
does this not work:
-------------------------------------------
/tmp/ccUN1Hel.o: In function `main':g++ test.cc
/tmp/ccUN1Hel.o(.text+0x26): undefined reference to `abs(int)'
collect2: ld returned 1 exit status
-------------------------------------------
#include <stdlib.h>cat test.cc
#include <stdio.h>
int main(){
int abs(int);
for (int jj=10;jj>=-10;jj--){
fprintf(stdout,"%d ===> %d\n",jj,abs(jj));
}
return 0;
}
-------------------------------------------
ABS(3) Linux Programmer'sman 3 abs
Manual ABS(3)
NAME
abs, labs, llabs, imaxabs - compute the absolute value of an
integer.
SYNOPSIS
#include <stdlib.h>
int abs(int j);
long int labs(long int j);
long long int llabs(long long int j);