For my reference, first I saw this post, but it didn't help me. I have the following code organised in headers and cpp files.
I am using netbeans with cygwin. When I compile the files, I don't get any error so I guess it is a linker error. The errors when I get trying to run the main project are:
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS'
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/EDS.exe
make[2]: Entering directory `/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS'
mkdir -p dist/Debug/Cygwin_1-Windows
g++.exe -o dist/Debug/Cygwin_1-Windows/EDS build/Debug/Cygwin_1-Windows/SortedListClass.o build/Debug/Cygwin_1-Windows/ListNodeClass.o build/Debug/Cygwin_1-Windows/main.o
build/Debug/Cygwin_1-Windows/main.o: In function `main':
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:13: undefined reference to `SortedListClass<int>::SortedListClass()'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:25: undefined reference to `SortedListClass<int>::insertValue(int const&)'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:29: undefined reference to `SortedListClass<int>::removeFront(int&)'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:40: undefined reference to `SortedListClass<int>::printForward() const'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:43: undefined reference to `SortedListClass<int>::printBackward() const'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:46: undefined reference to `SortedListClass<int>::clear()'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:49: undefined reference to `SortedListClass<int>::getNumElems() const'
/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS/main.cpp:56: undefined reference to `SortedListClass<int>::getElemAtIndex(int, int&)'
collect2: ld returned 1 exit status
nbproject/Makefile-Debug.mk:59: recipe for target `dist/Debug/Cygwin_1-Windows/EDS.exe' failed
make[2]: *** [dist/Debug/Cygwin_1-Windows/EDS.exe] Error 1
make[2]: Leaving directory `/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS'
nbproject/Makefile-Debug.mk:56: recipe for target `.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/i/Codes/Windows 7 Ultimate/NetBeansProjects/EDS'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
Please help me out. I even tried out directly copying the code from that post and it worked perfectly fine. with absolutely no errors. I am new to this type of code organising so can you please help me out?