This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/53981] New: gcc.dg/20020201-1.c fails with Android NDK


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]