I did many and many test looking at your guides and tutorial... I waste a lot of time but... the situation is that:

1) Compiling helloworld.c with mipsel-uclibc-gcc -o hello hello.c
I can obtain hello executable.
If I run hello on the router I get
"./hello: can't load library 'AP'"

2) If after compiling I write mipsel-uclibc-ld hello
I can obtain an a.out executable that works on the router.
If I rename the file a.out -> hello on my PC then I go back to error shown on point 1.
If I copy a.out to the router and then rename it as hello all works well!

3) Compiling helloworld.c with mipsel-uclibc-gcc -static -o hello hello.c
I can get hello executable but when I run it on the router I get segmentation fault...

Please help! I'm becoming mad!

Where I'm wrong?