I have the following files:
listDriverTest.cpp
src/List.cpp
headers/List.h
The include in List.cpp is
#include "../headers/List.h"
The include in listDriverTest.cpp is
#include "headers/List.h"
When I compile with the following statement,
g++ listDriverTest.cpp "src/List.cpp"
I end up with a fair number of 'undefined reference' errors, e.g.
listDriverTest.cpp:(.text+0x81): undefined reference to `List<int>::List()'
listDriverTest.cpp:(.text+0x8f): undefined reference to `List<int>::add(int)'
listDriverTest.cpp:(.text+0x9d): undefined reference to `List<int>::add(int)'
...
How should I properly use includes and compile these three files in order for the compilation to work properly? I have gotten listDriverTest.cpp to compile and run properly with all the files in the same directory, but not when they're broken up like this.