'Which libraries are needed for openssl's BIGNUM?

I need to generate RSA keys and it seems like openssl is the most common library that supports keys of length 3072. MinGW seems to come with pre-compiled libraries for it, so I tried linking -lcrypto and -lssl. However, when I just try to use

BIGNUM* someBigNum = BN_new();

I got the following error:

undefined reference to `BN_new'
collect2.exe: error: ld returned 1 exit status

What other library do I need to link?



Solution 1:[1]

BN_new is part of -lcrypto, but on Windows you may need to use -leay32

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brecht Sanders