I've a simple code - this works on other platforms but does not work in ubuntu.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x=99;
char str[100];
itoa(99, str, 10);
return 0;
}
Trying to compile in using terminal in gcc with :
gcc test.c
But I get the error:
/tmp/ccJN77g6.o: In function `main':
test.c:(.text+0x35): undefined reference to `itoa'
collect2: ld returned 1 exit status
Why so? prototype for itoa is included in stdlib.h
itoafunction, which is contained by C library implementations on some other operating systems. So should this really be considered off-topic for our site? Is the community at Stack Overflow really better suited to this question? In any case, if the answer is yes, I suggest this be migrated. – Eliah Kagan Oct 6 '12 at 1:01