Nana C++ Library An open-source C++ framework project The Installation Library Documentation |
||
When you extract the library from its zip files, you have to install the library
and configurate it before using. For the Integrated Development Environment(IDE), you can use the general way to install the library. Step 1: Start the IDE you use, set C++ include folder and library folder by the library installation directory(%nana%). Include folder: %nana%/include Library folder: %nana%/extrlib, %nana%/build/bin/%ide% Step 2: Create a static linkage library project and add all the files in %nana%/source and all sub directorires to the project, and compile it. Then you will get a static linkage library file. Step 3: Then you can compile your Nana application projects successfully with the static linkage library file. Be sure the compilation supports the RTTI, multi-threading and exceptions. The compiler environment are: Nana.C++03 - Microsoft Visual C++ Toolkit 2003 - Microsoft Visual C++ 2005 Express Beta1 with Microsoft SDK - Dev-C++ 4.9.9.2 - GCC 3.2 with XLib Nana.C++11 - Microsoft Visual C++ 2012 RC - GCC 4.7 For the specified IDE, you can follow these steps: Microsoft Visual C++ 2003/2005/2008/2010/2012 1. Setting the Nana include path and library path to the IDE: Microsoft Visual C++ 2003/2005/2008: Click the Tools menu>>Options>>Projects and Solutions>>VC++ Directories>>Select include files for "Show directories for". Add the Nana include folder(not the "nana" folder in the "include") and library path("%nana%/build/bin/vc7.1(/vc8/vc9)" and "%nana%/extrlib"). Microsoft Visual C++ 2010/2012: Open "%UserProfile%/AppData/Local/Microsoft/MSBuild/v4.0", %UserProfile% is a system environment variable. You can see the files "Microsoft.CPP.XXX.user.props", choose one of them for your target platform, and open it with a text editor program, such as notepad. Insert the "%nana%/include" in its <IncludePath> section. Insert the "%nana%/build/bin/vc10" and "%nana%/extrlib" in its <LibraryPath>, and split them up with a semicolon. 2. Compiling the Nana: Open %nana%/build/VC7.1(VC8/VC9/VC10/VC2012)/Nana.sln with MS Visual C++ 2003/2005/2008/2010/2012. Click the Build menu and select Rebuild All. When it's finish, a nana_debug.lib/nana_release.lib is generated in the "bin/vc7.1(/vc8/vc9/vc10/vc2012)" folder. You can find the "bin" folder in "%nana%/build". 3. Programming with the Nana: Create a Win32 Application Project, and make it as an empty project. Change properties of the project. C/C++ >>Code Generation> Runtime Library>>/MDd Link the static linkage file. Click the Linker>>Command>>Addtional Options, input the Nana static linkage file nana_debug.lib/nana_release.lib. Code::Blocks 1. Setting the Nana include path and library path to the IDE: Click the menubar "Settings>>Compiler..." to open Global compiler settings dialog. Select the "Search directories>>Compiler", add "%Nana%/include" directory(%Nana% is a directory where Nana is), add "/usr/include/freetype2" directory for Linux(the path of freetype2 is depended on your system), and then, switch to the "Linker" add %Nana%/build/codeblocks. 2. Compiling the Nana: MinGW:
Start to compile. Open the "%Nana%/build/codeblocks/nana.cbp" and build. Don't forget "-std=c++0x" or "-std=c++11" when building the Nana.C++11. 3, Programming with Nana 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: -lnana -lX11 -lpthread -lrt -lXft -lpng(if the support of PNG is enabled) -lasound(if nana::audio::player is called). Return |
||