I have problem while compiling two classes.
MemoryTrie.h:
#ifndef MEMORYTRIE_H
#define MEMORYTRIE_H
template <typename T>
class MemoryTrie
{
    public:
        ...
        T & operator [](const char * key);
    private:
        ...
};
#endif  /* MEMORYTRIE_H */
MemoryTrie.cpp:
#include "MemoryTrie.h"
template <typename T>
T & MemoryTrie<T>::operator [](const char * key)
{
    ...
}
OutputFileTrie.h:
#ifndef OUTPUTFILETRIE_H
#define OUTPUTFILETRIE_H
#include "MemoryTrie.h"
template <typename T>
class OutputFileTrie
{
    public:
        T & operator [](const char * key);
    private:
        MemoryTrie<T> memoryTrie;
};
#endif  /* OUTPUTFILETRIE_H */
OutputFileTrie.cpp:
#include "OutputFileTrie.h"
template <typename T>
T & OutputFileTrie<T>::operator [](const char * key)
{
    return memoryTrie[key];
}
And in main just:
OutputFileTrie<int> trie;
Linker says: OutputFileTrie.h:9: undefined reference to `MemoryTrie::MemoryTrie()'. I ran just these four commands:
g++ -Wall -pedantic -g -c MemoryTrie.cpp
g++ -Wall -pedantic -g -c OutputFileTrie.cpp
g++ -Wall -pedantic -g -c main.cpp
g++ MemoryTrie.o OutputFileTrie.o main.o -o out
Am I doing it right? Is there any mistake I missed? Thanks for any kind of help.
