1

I'm trying to get the library at https://github.com/Duthomhas/CSPRNG to work.

Here is my code:

#include <iostream>
#include <duthomhas/csprng.hpp>

int main(int argc, const char * argv[]) {
    duthomhas::csprng rng;

    return 0;
}

When I compile this, I get two errors: "Undefined symbol: _csprng_create" and "Undefined symbol: _csprng_destroy". This doesn't make sense to me since the csprng.h file, which is included in csprng.hpp, defines the functions csprng_create() and csprng_destroy(). So why doesn't the compiler admit the existence of these functions? How do I solve this?

  • I found what the problem was. Header files don't include implementations of functions, only definitions. There's a cpp file in the package which includes these implementations, which I've now included, and now the program compiles just fine. – Måns Nilsson Apr 11 '19 at 20:29

1 Answers1

2

Header files don't include implementations of functions, only definitions. There's a cpp file in the package which includes these implementations, which I've now included, and now the program compiles just fine.