Question: My Question: How does one get Halide working in a windows environment? I have been unable to find any real documentation for windows (part of the 'rough edges' I expect).

My Situation:
I'm trying to use Halide in a cross-platform (windows, mac, android) situation, and I'm having a lot of trouble getting it to work in VS2013. Using the prebuilt binaries everything runs and compiles just fine, but when I try and actually *run* the program, the line

```
Halide::Func gradient("gradient");

```

throws a std::bad\_alloc exception in the Halide.DLL. I'm starting to suspect that perhaps the Halide windows binaries were compiled for use with the MinGW toolchain or some other non-msvc solution and my problems stem from that. Any ideas?

Update: I can now run without hitting this problem, but only in Release builds. Defining \_DEBUG and/or linking with /MDd causes the crash.

Answer: 
I do not know the details about the binaries provided by the Halide team, but your problem may be that MSVC often prevents to mix debug and release binaries, especially if they use the STL (see [this answer](https://stackoverflow.com/questions/10916816/dll-in-debug-mode-calling-program-in-release-mode-and-vice-versa/10917015#10917015))

Building [LLVM/Clang](http://clang.llvm.org/get_started.html) and Halide from source is easier that it looks and will allow you to build binaries suited to your build environment. I recently built [LLVM 3.5/Clang](http://llvm.org/releases/download.html#3.5.0) and the latest Halide with VS2012 without problems. 

First build LLVM in Debug and Release (maybe 1 ou 2 hours each...). Then run cmake for Halide once for Debug and once for Release, with different build directories.
I've been able to get Halide working on the new Windows Subsystem of Linux without any issues. I used `gcc4.8` to compile the tutorials.