maTH
  • 👋Welcome!
  • 🗿Installation
  • Reference
    • 😱Mathematical operations
      • add
      • pascal
      • factorial
      • factorialL
      • GCD
      • LCM
      • pow
      • permutations
      • combinations
      • combinationsWithRep
      • subtract
      • multiply
      • divide
      • sin
      • cos
      • ln
      • log
      • radToDeg
      • degToRad
      • mod
      • abs
      • floor
      • ceil
      • root
      • exp
      • tan
      • arcsin
      • arccos
      • arctan
      • sinh
      • cosh
      • round
    • 🥶Statistics
      • Binomial
      • Poisson
      • Geometric
      • Pascal
      • Hypergeometric
      • Exponential
      • Uniform
    • 🥵Data structures
      • Stack
      • Queue
      • LinkedList
    • 🤓Algorithms
      • Bubble sort
      • Insertion sort
      • Selection sort
      • Merge sort
      • Quicksort
      • Heap sort
      • Count sort
      • Bucket sort
      • Radix sort
    • 😳Constants
Powered by GitBook
On this page
  • Install the library
  • Including the library to your project, the manual way
  • Including the library to your project, using CMake

Installation

PreviousWelcome!NextMathematical operations

Last updated 2 months ago

This page serves as a guide to installing and properly using the libary in your project.

Install the library

To install the library, simply do git clone https://github.com/timhaj/maTH.git.

Including the library to your project, the manual way

To run your code with the library, simply run:

g++ <file_name> -L. -lmaTH -o main_executable

and run the executable using ./main_executable or main_executable.exe

Don't have g++ compiler installed?

Incase you're changing the code and the included library doesn't work anymore, compile the source code to an object file with:

g++ -c maTH.cpp -o maTH.o

and create the library with:

ar rcs libmaTH.a maTH.o

Including the library to your project, using CMake

After modifying your CMakeLists.txt (a demo already included in the repository), you can build the project with these instructions:

mkdir build
cd build
cmake ..
make
main

Incase the Makefile doesn't appear, use:

mkdir build
cd build
cmake -G "Unix Makefiles" ..
make
main
🗿
Check the installation guide here