P
pb
Im getting this compile error,
undefined reference to BitString<10>::scramble()
collect2: ld returned 1 exit status
For some reason the compiler cant find the symbol for the member function i
declare. Everythign compiles correctly up to the point when i make a call to
the "scramble" routine. Calling the member functions of the base class work
just fine, but when i try to call the member functions i declare in the
extened class, the linker cant find the symbols. any ideas?
thx for the help...
// BitString.h
#include <bitset>
using namespace std;
template <size_t N>
class BitString : public bitset <N> {
public:
Bitstring <N>():bitset<N>(){};
void scramble();
};
//Bitstring.cpp
template <size_t N>
BitString<N>::scramble()
{
return;
}
// main.cpp
#include "BitString.h"
int
main()
{
BitString<10> data;
data.scramble()
return;
}
undefined reference to BitString<10>::scramble()
collect2: ld returned 1 exit status
For some reason the compiler cant find the symbol for the member function i
declare. Everythign compiles correctly up to the point when i make a call to
the "scramble" routine. Calling the member functions of the base class work
just fine, but when i try to call the member functions i declare in the
extened class, the linker cant find the symbols. any ideas?
thx for the help...
// BitString.h
#include <bitset>
using namespace std;
template <size_t N>
class BitString : public bitset <N> {
public:
Bitstring <N>():bitset<N>(){};
void scramble();
};
//Bitstring.cpp
template <size_t N>
BitString<N>::scramble()
{
return;
}
// main.cpp
#include "BitString.h"
int
main()
{
BitString<10> data;
data.scramble()
return;
}