commonlib
README

CommonLib is a set of classes that can be shared across projects. Idea is to to add common functionality between projects and to write code only once. Everyone is welcome to contribute to the library.

Requirements

  1. Visual Studio 2017 or higher
  2. CMake 3.13 or higher (https://cmake.org)

Basic Installation

  1. Install all required tools
  2. Enter commonlib directory (cd C:\SourcePath\commonlib)
  3. Create and enter "build" or directory (md build, cd build)
  4. Run cmake

Windows 32-bit: cmake -G "Visual Studio 15 2017" .. -DCMAKE_INSTALL_PREFIX=C:\\InstallPath\\CommonLib
Windows 64-bit: cmake -G "Visual Studio 15 2017 Win64" .. -DCMAKE_INSTALL_PREFIX=C:\\InstallPath\\CommonLib

This will create x86 or x64 solution file with Release and Debug targets and will install.

Basic Installation in VC

Open solution file from build folder and run the INSTALL project, this will create library files.

Using libraries in project

Open project and go to VC++ Directories page (Project -> Properties -> VC++ Directories).
Add header files from cmake under "Include Directories" (e.g. C:\InstallPath\CommonLib\Include).
Add lib files from cmake under "Library Directories" (e.g. C:\InstallPath\CommonLib\lib).

Inside your project you can include header files like this:
```cpp #include <commonlib/memory/memorywatch.h> ````

and you need to use namespaces (e.g. using namespace Dewesoft::Utils::Memory)

  • for examples on how to use the library look at the testcommonlib project/test_memory.cpp file