So whats the story about libcouchbase and Windows?
A couple of days ago I showed you an example program using libcouchbase to create a small application to put data into a Couchbase cluster, but the code wouldn't compile on Windows. That does by no means imply that libcouchbase doesn't work on Windows, its more that I was in a hurry writing the blog post so I didn't have the time fixing everything up in time for the blog post.
In this blog post I'll show you how easy it is to get everything up'n'running using Windows 7 and Microsoft Visual Studio 2010. In addition to that you need to download and install git to be able to check out the source code (select the option that you want to put git in the path (not the full msys suite, but just git)).
I have to admit that I am far from a "hardcore Windows developer", so there is a lot of things I don't know about the platform. For instance I don't know where I should install third party header files and libraries, so I just decided that I'm going to install all of them into C:\local (with an install, lib and bin directory). I'd be happy if someone could tell me how I'm supposed to do this ;-)
So let's open up the Visual Studio Command Prompt and start building everything:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC> <b>cd %HOMEPATH%</b>
C:\Users\Trond> <b>mkdir build</b>
C:\Users\Trond> <b>cd build</b>
Since we're going to build dll's you need to set C:\local\bin into your path so that the runtime linker finds the dll's:
We need to install two dependencies before we can compile libcouchbase itself. Let's check out all of the source code we're going to use:
C:\Users\Trond\build> <b>git clone git://github.com/membase/libvbucket.git</b>
C:\Users\Trond\build> <b>git clone git://github.com/couchbase/libcouchbase.git</b>
C:\Users\Trond\build> <b>git clone git://github.com/membase/memcached.git</b>
C:\Users\Trond\build> <b>git clone git://github.com/trondn/vacuum.git</b>
C:\Users\Trond Norbye\build\libisasl> <b>nmake -f NMakefile install</b>
C:\Users\Trond\build\libvbucket> <b>nmake -f NMakefile install</b>
C:\Users\Trond\build\memcached> <b>git checkout -b branch-20 origin/branch-20</b>
C:\Users\Trond\build\memcached> <b>mkdir c:\local\include\memcached</b>
C:\Users\Trond\build\memcached> <b>copy include\memcached c:\local\include\memcached</b>
C:\Users\Trond\build\libcouchbase> <b>nmake -f NMakefile install</b>
C:\Users\Trond\build\vacuum\Debug> <b>vacuum -h 127.0.0.1:8091</b>