I have a homework to deal with big number, but I cannot compile the most simple version of code. There are three files (.hh, .cpp and a test .cpp). Codes here: bignum.hh:
#pragma once
#include <cstdint> // uint8_t
#include <iostream> // ostream
namespace bistro
{
template <typename T = uint8_t>
class BigNum
{
public:
BigNum(std::size_t base);
private:
};
}
bignum.cpp:
#include "bignum.hh"
namespace bistro
{
using std::size_t;
// debug
using std::cout;
using std::endl;
template<typename T>
BigNum<T>::BigNum(size_t base) {
cout << base << endl;
}
}
test0.cpp:
#include "../src/bignum.hh"
using bistro::BigNum;
int main() {
BigNum<uint8_t> *b = new BigNum<>(10);
return 0;
}
and I use this command to compile them:
g++ -std=c++14 src/bignum.cpp tests/test0.cpp -o tests/test0
Here is the problem: enter image description here So, where is the problem?