CMake, GoogleTests and at least C++17
The project contains 5 different folders:
include
- the library header is stored heresrc
- stores the library implementationexamples
- stores the main.cpp where you can use the librarytests
- contains the tests using the GoogleTests framework
Follow these steps to build and run LongArithmeticLib, including tests and examples:
- Clone the LongArithmetic repository to your local machine:
https://github.com/avept/Long-Arithmetic.git
- Navigate to the project directory:
cd Long-Arithmetic
- Create a build directory:
mkdir build
cd build
- Generate the build system using CMake:
cmake ..
- Build the library:
make -j4
- After building the library, you can run the tests using the following command:
./test/LongArithmeticTests
- Once the library is built, you can run the example program by executing:
./example/main
This program demonstrates the usage of LongArithmetic for long arithmetic operations.
To use LongArithmetic in your own project, follow these steps:
- Include the necessary header files in your C++ code:
#include "include/BigInt.h"
- Link your project with the LongArithmetic library:
target_link_libraries(YourProjectName LongArithmetic)
- Use the provided functions for long arithmetic operations in your code.