To link to libnana.a, use the parameter -lnana. g++ searches for the library in the directory specified after -L which in this case is just a dot because I tested the library by copying the whole libnana.a file to the current directory.
-s saves a ton of space. Without it the exe was 38 MB. With -s it's only 1,2 MB.
I have downloaded the latest hotfix version 1.7.4: https://github.com/cnjinhao/nana/tree/0a9e599974ef8751de73691f49b9764536e0ff08
Compiling with visual studio
I use visual studio 2017. The visual studio project for version 2015 works with 2017.
At first the build fails. The solution is to uncomment line 58 in config.hpp in the nana source code:
This setting should be /MDd only for the debug version:
Then building Release and Debug versions of the library works. The result are two files: nana_v141_Debug_x64.lib and nana_v141_Release_x64.lib
Using the library with visual studio
Add the path to it to the Linker Additional Dependencies:
Compiling with GCC and MinGW-w64
I use the CMake GUI. Later I want to use the commandline version to automate this process.
Choose the location of the source code. This is the directory of nana that contains CMakeLists.txt.
Also here the nana filesystem can be enabled by checking NANA_CMAKE_NANA_FILESYSTEM_FORCE.
Then CMake can be configured to generate a mingw makefile:
After generating, the generated makefile is in the "where to build the binaries" directory. The library can be built with the command:
from that directory.
This yields a libnana.a file.
Using the library with GCC and MinGW-w64
Example:
To link to libnana.a, use the parameter
-lnana
. g++ searches for the library in the directory specified after-L
which in this case is just a dot because I tested the library by copying the whole libnana.a file to the current directory.-s
saves a ton of space. Without it the exe was 38 MB. With-s
it's only 1,2 MB.