Registry / crypto / gmp
library6.3.0vcpkgunverified

The GNU Multiple Precision Arithmetic Library for arbitrary-precision arithmetic.

vcpkg install gmp
INSTALL
IMPORT
SIG · GMP
G
gmp
cryptocppv6.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gmp.h
#include <gmp.h>

Add two large integers using GMP.

#include <gmp.h> #include <stdio.h> int main() { mpz_t a, b, sum; mpz_init_set_str(a, "12345678901234567890", 10); mpz_init_set_str(b, "98765432109876543210", 10); mpz_init(sum); mpz_add(sum, a, b); gmp_printf("%Zd\n", sum); mpz_clear(a); mpz_clear(b); mpz_clear(sum); return 0; }
Debug
Known issues
gotchaGMP is a C library; C++ wrappers (gmpxx.h) require separate linking with -lgmpxx.
fix
Use target_link_libraries(your_target GMP::GMP) for C; add GMP::gmpxx for C++.
affects: all
Upgrade
Version history
6.3.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources

No resource links recorded.

gmp — pip install gmp · libregistry