[Bug testsuite/53981] New: gcc.dg/20020201-1.c fails with Android NDK
anna.m.tikhonova at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 16 14:05:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53981
Bug #: 53981
Summary: gcc.dg/20020201-1.c fails with Android NDK
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: anna.m.tikhonova@gmail.com
Created attachment 27803
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27803
Proposed fix
Hi,
when I compile gcc.dg/20020201-1.c with android ndk gcc (4.4 or 4.6) I get the
following error:
/tmp/ccK41Qjx.o: In function `doit':
20020201-1.c:(.text+0x43): undefined reference to `srand'
20020201-1.c:(.text+0x48): undefined reference to `rand'
20020201-1.c:(.text+0x55): undefined reference to `rand'
collect2: ld returned 1 exit status
In srand man it is stated that you need to include stdlib.h for (s)rand.
Adding #include <stdlib.h> fixes the issue.
Thanks,
Anna
More information about the Gcc-bugs
mailing list