title: CUDA linking error - Visual Express 2008 - nvcc fatal due to (null) configuration file
body: <p>I've been searching extensively for a possible solution to my error for the past 2 weeks. I have successfully installed the Cuda 64-bit compiler (tools) and SDK as well as the 64-bit version of Visual Studio Express 2008 and Windows 7 SDK with Framework 3.5. I'm using windows XP 64-bit. I have confirmed that VSE is able to compile in 64-bit as I have all of the 64-bit options available to me using the steps on the following website: (since Visual Express does not inherently include the 64-bit packages)</p>
  
  <p><a href="http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/" rel="nofollow noreferrer">http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/</a></p>
  
  <p>The registry updates for 64-bit installation are found in a user comment on the same page as the above link.</p>
  
  <p>I have confirmed the 64-bit compile ability since the "x64" is available from the pull-down menu under "Tools->Options->VC++ Directories" and compiling in 64-bit does not result in the entire project being "skipped". I have included all the needed directories for 64-bit cuda tools, 64 SDK and Visual Express (\VC\bin\amd64).</p>
  
  <p>Here's the error message I receive when trying to compile in 64-bit:</p>
  
  <pre><code>1&gt;------ Build started: Project: New, Configuration: Release x64 ------
  1&gt;Compiling with CUDA Build Rule...
  1&gt;"C:\CUDA\bin64\nvcc.exe"    -arch sm_10 -ccbin "C:\Program Files (x86)\Microsoft    Visual Studio 9.0\VC\bin"    -Xcompiler "/EHsc /W3 /nologo /O2 /Zi   /MT  "  -maxrregcount=32  --compile -o "x64\Release\template.cu.obj" "c:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\CUDA_Walkthrough_DeviceKernels\template.cu" 
  1&gt;nvcc fatal   : Visual Studio configuration file '(null)' could not be found for installation at 'C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/../..'
  1&gt;Linking...
  1&gt;LINK : fatal error LNK1181: cannot open input file '.\x64\Release\template.cu.obj'
  1&gt;Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\New\New\x64\Release\BuildLog.htm"
  1&gt;New - 1 error(s), 0 warning(s)
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>Here's the simple code I'm trying to compile/run in 64-bit:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  
  #include &lt;cuda.h&gt;
  
  void mypause () 
  { 
    printf ( "Press [Enter] to continue . . ." );
    fflush ( stdout );
    getchar();
  } 
  
  __global__ void VecAdd1_Kernel(float* A, float* B, float* C, int N)
  {
   int i = blockDim.x*blockIdx.x+threadIdx.x;
   if (i&lt;N)
    C[i] = A[i] + B[i]; //result should be a 16x1 array of 250s
  } 
  
  __global__ void VecAdd2_Kernel(float* B, float* C, int N)
  {
   int i = blockDim.x*blockIdx.x+threadIdx.x;
   if (i&lt;N)
    C[i] = C[i] + B[i]; //result should be a 16x1 array of 400s
  }
  
  int main()
  {
   int N = 16;
   float A[16];float B[16];
   size_t size = N*sizeof(float);
  
   for(int i=0; i&lt;N; i++) 
   {
    A[i] = 100.0;
    B[i] = 150.0;
   }
  
   // Allocate input vectors h_A and h_B in host memory
   float* h_A = (float*)malloc(size);
          float* h_B = (float*)malloc(size);
          float* h_C = (float*)malloc(size);
  
   //Initialize Input Vectors
   memset(h_A,0,size);memset(h_B,0,size);
   h_A = A;h_B = B;
  
   printf("SUM = %f\n",A[1]+B[1]); //simple check for initialization
  
   //Allocate vectors in device memory
   float* d_A;
   cudaMalloc((void**)&amp;d_A,size);
   float* d_B;
   cudaMalloc((void**)&amp;d_B,size);
   float* d_C;
   cudaMalloc((void**)&amp;d_C,size);
  
   //Copy vectors from host memory to device memory
   cudaMemcpy(d_A,h_A,size,cudaMemcpyHostToDevice);
   cudaMemcpy(d_B,h_B,size,cudaMemcpyHostToDevice);
  
   //Invoke kernel
   int threadsPerBlock = 256;
   int blocksPerGrid = (N+threadsPerBlock-1)/threadsPerBlock;
   VecAdd1(blocksPerGrid, threadsPerBlock,d_A,d_B,d_C,N);
   VecAdd2(blocksPerGrid, threadsPerBlock,d_B,d_C,N);
  
   //Copy results from device memory to host memory
   //h_C contains the result in host memory
   cudaMemcpy(h_C,d_C,size,cudaMemcpyDeviceToHost);
  
   for(int i=0; i&lt;N; i++) //output result from the kernel "VecAdd"
   {
    printf("%f ", h_C[i] );
    printf("\n");
   }
   printf("\n");
  
   cudaFree(d_A); 
   cudaFree(d_B); 
   cudaFree(d_C);
   free(h_A);
   free(h_B);
   free(h_C);
  
   mypause();
   return 0;
  }
  </code></pre>