Skip to content

Instantly share code, notes, and snippets.

@Vagabond
Last active Aug 29, 2015
Embed
What would you like to do?

Building libhelium on Windows 2012 server R2

First, get Visual C++ 2010 Express and install it: http://www.visualstudio.com/downloads/download-visual-studio-vs#DownloadFamilies_4

Install cmake for windows (get the windows installer): http://www.cmake.org/download/

Install python for windows (I've only tested with 2.7.x): https://www.python.org/downloads/windows/

Make sure when installing python to enable the 'Add python.exe to Path' option in the installer.

Install git for windows: http://git-scm.com/download/win

Make sure you check 'Use Git from the Windows Command Prompt' in the installer.

Download precompiled openssl binaries from here: http://www.npcglib.org/~stathis/blog/precompiled-openssl/

Make sure you get the latest 1.0.1 (or later) built with MSVC 2010. You will need 7-zip from 7-zip.org to extract the archive, if you don't already have it. Extract the archive somewhere.

At this point, just reboot to get all the path changes to apply.

Download a source zip of libuv: https://github.com/joyent/libuv/archive/v1.0.0-rc2.zip

(A later tag of libuv may be available, you can probably use that instead)

Unzip the libuv archive somewhere.

Open a cmd.exe window or powershell cd into the libuv directory and run 'vcbuild.bat'

If it fails to git clone https://git.chromium.org/external/gyp.git you can do it manually over http:

cd build
git clone http://git.chromium.org/external/gyp.git
cd ..
vcbuild.bat

Libuv will build.

Now, download libhelium source archive: https://github.com/helium/libhelium/archive/master.zip

Extract that somewhere, and then run CMake (cmake-gui) (can be found in the start menu). Use the 'Browse source' button to browse to the libhelium directory. Use the 'Browse Build' directory to browse to the libhelium directory, but add a 'build' directory on the end of the path. Then press the 'Configure' button. Tell it yes when it asks to create the build directory. A popup asking for the 'generator for this project' will appear, select 'Visual Studio 2010' and hit 'Finish'. You will get some errors about libuv paths being NOTFOUND. Click on UV_INCLUDE_DIR and browse to the directory you extracted libuv to and select the 'include' folder. For UV_LIBRARIES browse to Debug/lib/libuv under the libuv directory to pick the library to link against.

Hit the 'Configure' button again, now some errors about OpenSSL will pop up. For OPENSSL_INCLUDE pick the path you extracted openssl to and select the 'include' subdirectory. For OPENSSL_LIBRARIES pick lib/ssleay32MDd.lib in the openssl directory. Run 'Configure' again. You'll get some new errors, this time about CRYPTO_INCLUDE_DIR and CRTPTO_LIBRARIES. For CRYPTO_INCLUDE_DIR use the same path as OPENSSL_INCLUDE_DIR for CRYPTO_LIBRARIES pick libeay32MDd.lib in the same directory as the OPENNSSL_LIBRARY's ssleay32MDd.lib.

Now run Configure and Generate again, you should not get any errors.

Now, browse to the libhelium directory and go into the 'build' directory. Open 'libhelium.sln' in visual studio 2010. You should now be able to 'build' the 'ALL_BUILD' target by right clicking on it. All 5 subprojects should build. Now copy libeay32MDd.dll and ssleay32MDd.dll into your libhelium build/Debug directory and you should be able to run shell.exe and multiloop_test.exe. If those run, you have successfully built libhelium.

@jaredmorrow
Copy link

jaredmorrow commented Oct 30, 2014

Please move the "Make sure when installing python to enable the 'Add python.exe to Path' option in the installer." to under the python installer line, rather than under Git.

@jaredmorrow
Copy link

jaredmorrow commented Oct 30, 2014

For openssl, you need to select the "openssl" directory in the "include" directory at this line:

" extracted openssl to and select the 'include' subdirectory."

@jaredmorrow
Copy link

jaredmorrow commented Oct 30, 2014

Specify "openssl/bin" as the directory to find those .dll's in the last step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment