Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm really new at linux. I just installed Ubuntu 12.04- I compiled and tried to run a program but it doesn't work and I don't have a clue why. searched on google but no one seems to have a problem with it. It must be a silly error.

the program is evhz.c (link here: http://web.archive.org/web/20060623094750/http://homepages.nildram.co.uk/~kial/evhz.c ). The program verifies the changed you done in the mouse polling rate. I used this guide: https://wiki.archlinux.org/index.php/Mouse_Polling_Rate

I used gcc -o evhz evhz.c to compile it.

First I got the error:

evhz.c: In function ‘main’: evhz.c:35:2: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]

I added #include string.h, as the guide suggested.

Then I tried to compile again and it was compiled with no warnings.

I used ./evhz to execute it as root. (The script has executable permissions.)

But nothing is shown on the screen: I only get : :~/Desktop$ ./evhz Press CTRL-C to exit.

It supposed to show a list of usb devices and their polling rate.

Any idea why isn't working, suggestions, or alternative programs to evhz?

share|improve this question
1  
This isn't an Ubuntu related issue, but a coding problem. –  LnxSlck Aug 11 '12 at 2:08
    
Or a problem with trying to use software that hasn't been updated in half a decade. –  Alex L. Aug 11 '12 at 2:35
1  
neither of both. –  Mr Tex Aug 12 '12 at 2:39
add comment

1 Answer 1

up vote 2 down vote accepted

There does not seem to be any obvious issues with the script (the only possible one being API changes, which are unlikely to be big enough to kill this, or to escape unnoticed by GCC) and it runs fine for me.

Try running sudo ./evhz to run it as root. What you show is running it as a normal user.

share|improve this answer
1  
Excellent answer The /dev/input/event* devices can only be read by root, or by someone in the root group (normally, once again, only root), so sudo is necessary. @Mr Tex, be sure you know that the program won't hurt your system and then take Alex's advice. I gather you will have to move your mouse to get any output beyond the initial information it prints. –  John S Gruber Aug 11 '12 at 4:34
1  
Thanks Alex, that solved the problem. the program is running well now. –  Mr Tex Aug 11 '12 at 14:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.