From BlenderWiki
Troubleshooting
Compile errors with Visual Studio 2008 PRO
When you get compile errors with functions from the c++ std:: library then please make sure that you have the "Visual studio 2008 Service pack 1" installed besides your Visual Studio 2008 Pro installation.
Cycles And CUDA Binaries
Currently CUDA GPU Toolkit 4.2 is supported: https://developer.nvidia.com/cuda-toolkit-42-archive
If you want to build with cycles and CUDA binaries you also need to install Microsoft Visual Studio (MSVC) 2008 as well and run the build process from a MSVC terminal. This is needed because the CUDA compiler needs to use the MSVC compiler.
For 64-bit builds(such as MinGW-w64) the CUDA compiler will need the 64bit toolset. It is possible to get this without MSVC professional by downloading the Windows SDK (version 7.1 has a very buggy installation but 7.0 iso should work) Additionally, there's one other thing to change for a 64-bit system. Apparently the cuda compiler has a "hard-coded" directory for 64-bit compilers. To make the fix, copy the needed file "vcvars64.bat" and rename it to "vcvarsamd64.bat" as follows:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
to
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
(method copied from: http://stackoverflow.com/questions/2970493/cuda-linking-error-visual-express-2008-nvcc-fatal-due-to-null-configuratio ) Then you should be able to generate 64bit kernels from a MSVC terminal.
nvcc fatal
When building via mingw and Windows SDK, Cuda compiler could fail with following message(even for 64bit building):
nvcc fatal : Visual Studio configuration file 'vsvars32.bat' could not be found for installation at 'C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/../../..'
to solve that problem, you need to copy 'vcvars32.bat' and rename it to 'vsvars32.bat' as follows:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
to
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
(this workaround was taken from nvidia dev talk forum: https://devtalk.nvidia.com/default/topic/462599/vsvars32-bat-not-found-error-on-compiling-samples-with-vsvars32-bat/)
Fail to start release or builds from buildbot
Usually this means the Microsoft Visual Studio 2008 redistributable packages aren't installed in your system. They can be easily found at Microsoft's download center page.
If you've got PYTHONPATH environment variable pointing to an older version of Python, it'll lead to Microsoft Visual C++ runtime library failure. If you've got such kind of error message, check on your environment variables.
Missing DLL's With MinGW
If you get a popup when configuring CMake or running SCons that says
libgmp-10.dll not found
This is because the DLL MinGW installs is not in the path, resolve this by adding "C:\MinGW\bin" to you're PATH environment variable.
MinGW & Redistribution
MinGW uses a few DLLs deal with runtime libraries so if you bundle builds for others, copy libgcc*.dll and libstdc++*.dll from MinGW/bin next to your new Blender executable. If you build with OpenMP, libgomp.dll will also be needed. This will make the builds usable even for people who don't have MinGW or PATH setup correctly.
Fail to Initialize with MinGW
If you get this error, installing python may resolve this, even though Blender comes with python.
The application failed to initialize properly (.....) Click on OK to terminate the application.
Debug Builds
Without MSVC 2008 installed you may get an error like this on launch.
The application failed to initialize properly (0xc9159992). Click on OK to terminate the application.
This is because python32_d.dll needs MSVC 2008 installed to run. Both the Full version or Express will work.
So even if you build with MinGW or MSVC 2010, to run debug builds you need MSVC 2008.
MSVC Express Has No OpenMP support
If you build with MSVC Express you must disable OpenMP (which will make some parts of Blender not use multiple processors).
- on SCons disable WITH_BF_OPENMP
- on CMake disable WITH_OPENMP
SCons Environment Variable problem
If one ore more environment variable contains a value with non-ASCII characters you'll see an error message appear since r34956 (older revision will throw a UnicodeDecodeError exception). It looks like this:
D:\blenderdev\currentsvn>python scons\scons.py BF_CONFIG=graphicall_32b scons: Reading SConscript files ... ================ @@ ABORTING BUILD @@ PROBLEM DETECTED WITH ENVIRONMENT --------------------------------- A problem with one or more environment variable was found Their value contain non-ascii characters. Check the below list and override them locally to be ASCII-clean by doing 'set VARNAME=cleanvalue' on the command-line prior to starting the build process: USERNAME = Näthan TESTVAR = ElNiño
You don't have to change the main environment, it's enough to override the offending variables for the session. You could create a .bat with the overrides, so it's easy to run it whenever you open a new VS command prompt.