CUDA 5.0 separate compilation example fails

Hello,

I am interested in building a cuda library that exports device variables and functions. Since this functionality was added with Cuda 5 I decided to try the example shown on http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#code-changes-for-separate-compilation.

After fixing the obvious typo in b.h and compiling the example according to the instructions, I get at runtime:

couldn’t get the symbol addr

indicating that the call to cudaGetSymbolAddress failed.

I tried this on Mac OS X Mountain Lion and Centos 6.3, both having the latest version of the CUDA SDK.

Any thoughts on why this fails?

Thanks in advance,

Tom