On Sun, Oct 30, 2011 at 9:29 PM, Dave Gilbert <[email protected]>
wrote:

> One difference from 10.04 is that the linker is more touchy about the
> order of link options, so make sure the -lrt is after the .o which
> requires it.

Interesting, and it solves the problem.

I have this code in a file named bug.c:

>  I am baffled. Here is a tiny program that also fails to compile, and
>  gives the sane error:
>
>  #include <time.h>
>
>  unsigned timetest()
>  {
>        struct timespec t ;
>        return( clock_gettime(CLOCK_REALTIME,&t)) ;
>  }

cc -lrt bug.c

gives two errors, not finding clock_gettime() or main()

cc bug.c -lrt

gives only one, not finding main()

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/882954

Title:
  gcc fails to compile legal code

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/882954/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to