Page 1 of 1

trouble Telling CPU Speed

Posted: Wed Oct 04, 2006 7:36 pm
by ZetItUp
reading this thread pointed by The FAQ
why do i get an error like this:

timer.o(.text+0x5e): in function 'cpu_speed()':
: undefined reference to `__udivdi3'

when i try using 'unsigned long long start=0, ...' ? :/

Re:trouble Telling CPU Speed

Posted: Thu Oct 05, 2006 3:03 am
by Pype.Clicker
the compiler doesn't know how to divide long longs natively: it needs a builtin function to do so...

Re:trouble Telling CPU Speed

Posted: Fri Oct 06, 2006 11:09 am
by CopperMan
To make this work, follow these steps :

1. Find your libgcc.a and copy it in a separate directory.
2. Execute commands :
ar x libgcc.a _udivdi3.o _umoddi3.o
ar r libm64.a _udivdi3.o _umoddi3.o
3. Then link libm64.a to your executable.

Works fine for me !