can run SDKs,but not my program: library not found for -lcudart

I have libcudart.dylib in the /usr/local/cuda/lib.
I can make in the SDKs directory,can run devicequery and other SDK sample.
But when I run my program, I write -L /usr/local/cuda/lib -lcudart, I got the wrong message library not found for -lcudart.
why? thank you.

harbor