Installation Library Documentations

When you extract the library from its zip files, you have to install the library and configurate it before using. There is a general steps to install the library.

General

Some terms for this instruction:
NanaPath: The path where Nana's files are located.
 IDEName: The name of a certain Integrated Development Environments. Such as vc7.1, vc8.
NanaStatic: The generated Nana static linkage file, a *.lib/*.a file.

BoostPath: The path where Boost C++ Libraries are located.

Step One:
Start the IDE you use, set C++ include path and library path.
    Include Path: NanaPath/include
     Library Path: NanaPath/extrlib, NanaPath/build/bin/IDEName.

Step Two:
Create a static linkage library solution within a IDE which you use, and add all the files which are placed in "NanaPath/source" and in its all sub directiories to the solution. Then compile the solution and you will get a static linkage file NanaStatic in the path "NanaPath/build/bin/IDEName".

Step Three:
Write a program and use Nana to create a GUI, and compile it with the NanaStatic file linked. Make sure that enable the compiler for supports of RTTI, MultiThreading and exception.

Microsoft Visual C++

1. Set directories
Microsoft Visual C++ 2003/2005/2008
Click the menu Tools->Options, and then it shows a Options dialog. Find  "Show directories for" which is in Projects and Solutions->VC++ Directories.

Add the Include Path "NanaPath/include" and the Library Path "NanaPath/build/bin/IDEName" and "NanaPath/extrlib".
Microsoft Visual C++ 2010/2012/2013
Open the directory of "%UserProfile%/AppData/Local/Microsoft/MSBuild/v4.0", the %UserProfile% is a system environment variable. Then you can find some files which are named like "Microsoft.CPP.XXX.user.props", choose one of them for your target platform, and edit it as follow:
Insert "NanaPath/include" to the section .
Insert "NanaPath/build/bin/IDEName(e.g. vc10/vc2012/vc2013)" and "NanaPath/extrlib" to the section , and split them up with a semicolon.

2. Compile Nana C++ Library
Open "NanaPath/build/IDEName(e.g. vc7.1/vc8/vc9/vc10/vc2012/vc2013)/Nana.sln" with Visual C++. Click the menu Build->Rebuild All.  After building, a NanaStatic(e.g. nana_debug.lib, nana_release.lib) file should be generated in "NanaPath/build/bin/IDEName".

3. Programming with Nana C++ Library
Create a Win32 Application Project, and make it as an empty project.
Change properties of the project. Open the solution Properties Dialog.

MDd and MTd for Debug Mode; MD and MT for Release Mode.
Choosing the MD/MDd or MT/MTd depends on the property which is chose for building the Nana.

Link the NanaStatic file.

Input the name of NanaStatic file, such as nana_debug.lib or nana_release.lib.

Code::Blocks

1. Set directories
Click menu Settings->Compiler... to open Global compiler settings dialog. Then, select Search directories->Compiler tab.

Add "NanaPath/include".
Add "/usr/include/freetype2" when it is in Linux. (The path of freetype2 may be different, it depends on your system).
And then, switch to the "Linker" and add "NanaPath/build/codeblocks".

2. Compile Nana C++ Library
MinGW
Configure the Boost C++ Library for Nana.C++11(Skip this step if you are installing Nana.C++03)
The Boost C++ Library is required due to , and being not supported by MinGW 4.7.x
    a, Insert the Boost includ directory to the "Settings->Compiler...->Search directories->Compiler".
    b, Append the MinGW path(e.g "C:\Program Files\CodeBlocks\MinGW\bin") to the "Path" which is one of Global Environment Variables.
    c, Open the "BoostPath/boost/thread/detail/config.hpp" header file and find the following lines.
        # if defined(BOOST_THREAD_PATH_WIN32)
        #      if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
        and modify
        # if defined(BOOST_THREAD_PATH_WIN32)
        #      if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32)
    d, Compile the Boost.Thread
        bjam toolset=gcc --build-type=complete --with-thread
    e, Add the Boost C++ Libraries to the Code::Blocks.
        "Settings->Compiler...->Linker Settings" add libraries as following order.
        libboost_system-mgwXX-mt-s-XXX.a
        libboost_thread-mgwXX-mt-s-XXX.a
        libboost_chrono-mgwXX-mt-s-XXX.a
        (Wrong order may cause "undefined reference" linker errors)

Start to compile.
    Open the "NanaPath/build/codeblocks/nana.cbp" and build it. Don't forget "-std=c++0x" or "-std=c++11" when building the Nana.C++11.

3. Programming with Nana C++ Library
Create a project, then open "Project->Build options...->Compiler settings->Compiler flags", and enable "-std=c++0x" or "-std=c++11" if it is Nana.C++11.
Switch the tab to "Linker settings" in "Project build options", and link these static libraries in "Other linker options".
Windows:
      -lnana -lgdi32 -lcomdlg32
Linux:
      -nana -lX11 -lpthread -lrt -lXft
      -lpng(if the support of PNG is enabled)
      -lasound(if nana::audio::player is called)