The NumberDuck.hpp and NumberDuck.cpp files can be dropped directly into your existing build setup.
The examples in the zip can also be built and ran from the command line, here's the simple example:
g++ -o SimpleExample SimpleExample.cpp ../NumberDuck.cpp ./SimpleExample
Alternatively you can use CMake to build and install a static library locally, by calling CMake with the SIMPLE_OUTPUT
flag, eg:
cmake -S . -B _build -DSIMPLE_OUTPUT=true cmake --build _build sudo cmake --install _build
This will build Number Duck (in the _build directory) and copy it to the default search paths for includes and libraries, so then you can just #include <NumberDuck.hpp>
in your code and link to NumberDuck
, eg:
g++ SimpleExample.cpp -lNumberDuck
Number Duck has also been tested with the CPM.cmake dependancy manager and works successfully.
CPMAddPackage("gh:NumberDuck/NumberDuck-CPlusPlus@3.0.6")
Note that the version number above might need to be updated.
The NumberDuck.cs file can be dropped directly into your Visual Studip project. You will also need to reference the System.IO.Compression assembly.
The examples in the zip can also be built and ran from the command line, here's the simple example using mono:
csc -debug:full -reference:System.IO.Compression.dll SimpleExample.cs ../NumberDuck.cs mono --debug SimpleExample.exe