issue running the SDK examples

I’m just installed all the cuda examples, and they seemed to make correctly, but when I attempt to run the executables I get the following error

dyld: Library not loaded: @rpath/libcudart.dylib
Referenced from: /Developer/CUDA/bin/darwin/release/./nbody
Reason: image not found
Trace/BPT trap

this happened for the first three examples that I tried. Is there something other than

export PATH=/usr/local/cuda/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH

that I need to add to .bash_profile?

Thanks for any help you can provide.

Curiously enough, all the demos appear to run correctly when I double click them through the finder. I’m still unsure why they work when finder launches them through a terminal window and not when I type ./demo_name into the command line in a terminal instance or an xterm instance.

I’m still confused.

Something is wrong with your DYLD_LIBRARY_PATH in the terminal.
What is the output of “echo $DYLD_LIBRARY_PATH” ?

Yeah, that was the problem. I just appended those lines to .bash_profile so there were 2 export PATH commands which messed it up so nothing was getting written to DYLD_LIBRARY_PATH. Fixed now. Thanks.

Hi I’m really new to this so I’ve muddled through and made the examples but I get this error too and am not sure how to resolve it with the solutions here in could anybody help?

Thanks