title: Why am I getting "undefined reference to `__cudaRegisterLinkedBinary_60_....`" errors in this libcufft_static example?
body: <p>I'm on Ubuntu 16.04 using the CUDA 7.5 SDK, installed via the <code>nvidia-cuda-toolkit</code> package. I'm trying to compile a simple test program using cuFFT's callback feature; the source code to the example is <a href="https://github.com/parallel-forall/code-samples/blob/master/posts/cufft-callbacks/cufft_callbacks.cu" rel="nofollow">available at GitHub</a>.</p>
  
  <p><a href="https://devblogs.nvidia.com/parallelforall/cuda-pro-tip-use-cufft-callbacks-custom-data-processing/" rel="nofollow">Following the instructions for compiling with the callback feature</a>, I'm compiling the source as relocatable device code and linking against <code>libcufft_static.a</code>:</p>
  
  <pre><code>nvcc -ccbin g++ -dc -m64 -o cufft_callbacks.o -c cufft_callbacks.cu
  nvcc -ccbin g++ -m64 -o cufft_callbacks cufft_callbacks.o  -lcufft_static -lculibos
  </code></pre>
  
  <p>In the above sequence, the final command fails with a series of errors, all similar to this one:</p>
  
  <pre><code>/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcufft_static.a(set_callback.o): In function `__sti____cudaRegisterAll_47_tmpxft_00003a6a_00000000_7_set_callback_cpp1_ii_b7e0d86d()':
  tmpxft_00003a6a_00000000-4_set_callback.cudafe1.cpp:(.text+0x6fd): undefined reference to `__cudaRegisterLinkedBinary_47_tmpxft_00003a6a_00000000_7_set_callback_cpp1_ii_b7e0d86d'
  </code></pre>
  
  <p>It complains about many missing symbols, all starting with <code>__cudaRegisterLinkedBinary_</code>. I don't think I'm doing anything wrong, as the same sequence of commands works properly on a CentOS 7 machine that I have on hand. </p>
  
  <p>Is it possible my SDK is misconfigured somehow? All mentions of similar problems I've seen on SO and elsewhere have been a failure to do the separate compilation steps shown above; I don't think that's the case here.</p>