I simply try to initialize the Botan AutoSeeded_RNG but it fails because of a bad reference. I just wanted to test if i can initialize any kind of botan RNG, corse i have trouble with it in another project.
I have the correct header included and am linking to the lib of Botan, therefore i don't know, why it can not find the referende.
Here is my code:
1 #include <botan/auto_rng.h>
2 #include <botan/ecdh.h>
3 #include <botan/ec_group.h>
4 #include <botan/pubkey.h>
5 #include <botan/hex.h>
6 #include <iostream>
7
8 int main() {
9
10 Botan::AutoSeeded_RNG rng;
11
12 return 0;
13 }
14
And here is my output:
~/projects $ g++ ecdh.cpp -o ecdh -I/usr/local/include/botan-2/ -L/usr/local/lib/
/usr/bin/ld: /tmp/cccPpNuZ.o: in function `main':
ecdh.cpp:(.text+0x18): undefined reference to `Botan::AutoSeeded_RNG::AutoSeeded_RNG(unsigned int)'
/usr/bin/ld: ecdh.cpp:(.text+0x28): undefined reference to `Botan::AutoSeeded_RNG::~AutoSeeded_RNG()'
collect2: error: ld returned 1 exit status
What am i doing wrong?
Thx for your advice in advance.