trouble Telling CPU Speed

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ZetItUp

trouble Telling CPU Speed

Post 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, ...' ? :/
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:trouble Telling CPU Speed

Post by Pype.Clicker »

the compiler doesn't know how to divide long longs natively: it needs a builtin function to do so...
CopperMan

Re:trouble Telling CPU Speed

Post 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 !
Post Reply