I am sure that is a stupid error of mine, but why the hell
does this not work:
-------------------------------------------
g++ test.cc /tmp/ccUN1Hel.o: In function `main':
/tmp/ccUN1Hel.o(.text+0x26): undefined reference to `abs(int)'
collect2: ld returned 1 exit status
------------------------------------------- cat test.cc #include <stdlib.h>
#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;
}
-------------------------------------------man 3 abs
ABS(3) Linux Programmer's
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);
-------------------------------------------
thanks, daniel