Skip to content
dnso86 edited this page Feb 9, 2019 · 3 revisions

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

  • Open the "NanaPath/build/codeblocks/nana.cbp"

  • Open "Project->Build options...->Compiler settings->Compiler flags", and enable "-std=c++11"

  • Open "Project->Build options...->Serch Directories->Compiler", and add $(#nana) and $(#boost)

  • Add the following defines

_enable_std_make_unique
_WIN32_WINNT=0x0501
_WIN32_WINNT_WINXP=0x0501
_WIN32_WINNT_VISTA=0x0600
_WIN32_WINNT_WIN7=0x0601
  • Buid. The library will be "NanaPath/build/codeblocks/libnana.a"

3. Programming with Nana C++ Library

Create a project, then open "Project->Build options...->Compiler settings->Compiler flags", and enable "-std=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 -lfontconfig
-lpng (if the support of PNG is enabled)
-lasound (if nana::audio::player is called)
Clone this wiki locally