GenericContainer
GenericContainer a tool for C++ programming
Loading...
Searching...
No Matches
Installation guide

Compile the Library

To compile the library, you'll need:

  • A C++17 compiler (e.g., GCC, Clang, or MSVC)
  • cmake for the compilation
  • Rake, a build automation tool (optional)

Using cmake

Open a terminal in the project's root directory and run the following command:

mkdir build
cd build
cmake ..
make
make install
cd ..

after that you should find something like this

lib
├── dll
│   ├── libGenericContainer_osx.dylib
│   └── libLua_osx.dylib
├── include
│   ├── GenericContainer
│   │   ├── GenericContainer.hh
│   │   ├── GenericContainerConfig.hh
│   │   ├── GenericContainerInterface_C.h
│   │   ├── GenericContainerInterface_json.hh
│   │   ├── GenericContainerInterface_lua.hh
│   │   ├── GenericContainerInterface_matlab.hh
│   │   ├── GenericContainerInterface_toml.hh
│   │   ├── GenericContainerInterface_yaml.hh
│   │   └── GenericContainerLibs.hh
│   ├── GenericContainer.hh
│   ├── lauxlib.h
│   ├── lua.h
│   ├── lua.hpp
│   ├── luaconf.h
│   └── lualib.h
└── lib
├── libGenericContainer_osx_static.a
└── libLua_osx_static.a

which is the statiuc and dynamic libraries and its headers.

To test the libray do

make test

Using rake + cmake

Open a terminal in the project's root directory and run the following command:

rake

or if the OS is not detected correctly

rake build_osx # compile for OSX
rake build_linux # compile for linux
rake build_win # compile for WINDOWS

check the library

To run the tests

rake run # for linux/OSX
rake run_win # for windows

Integrate into Your Project

  • Include Headers: Add the include/ directory to your project's include path.
    g++ -I/path/to/lib/include your_project.cpp -o your_project
  • Link the Library: Use the -L and -l flags to link against the library:
    g++ -L/path/to/lib/lib -lyourlibrary your_project.cpp -o your_project

Verify the Installation

Compile and run your project to verify that it works with the newly linked library.