The Easiest Way to Install Nana for Visual Studio

I’m happy to announce that vcpkg has added Nana 1.4.1. Vcpkg is a tool released by Microsoft to simplifies acquiring and building C++ open source libraries on Windows.

1, Installing the vcpkg is very easy, please refer to its instruction on github https://github.com/Microsoft/vcpkg.

2, Open command prompt, and install nana with following command.

vcpkg install nana & vcpkg integrate install

Now, open Visual Sutdio, start a win32 project, #include <nana/gui.hpp>. Done!

2 Comments

  1. Works! Takes a really long time to download everything in vcpkg though. They didn’t mention that you run the vcpkg commands in Command Prompt. Also, make sure you don’t miss any characters or have any spaces in the vcpkg path, as this may screw up the installation and you’ll have to start all over.

    Here’s minimal code for a Nana application in Visual Studio 2015 in “main.cpp”:

    #include <nana/gui.hpp>
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>

    using namespace nana;

    int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
    form f;
    f.show();
    exec();
    }

Leave a Reply