Re: Cannot use static linking with librt.a?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/03/2012 11:28 PM, Hei Chan wrote:

> I have searched online for awhile and I still can't find a good explanation why I can't use static linking with librt.a.
> 
> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/librt.a(clock_gettime.o): In function `clock_gettime':
> (.text+0x197): undefined reference to `_dl_cpuclock_offset'
> collect2: ld returned 1 exit status
> 
> 
> It seems like librt.a is a static library but it doesn't use static linking for its actual implementation _dl_cpuclock_offset?

That's right.  It seems to me like your  `_dl_cpuclock_offset' actually
requires the dynamic linker.  There's only one solution: download the
source of your librt and have a look.

Andrew.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux