#156794 - Maxxie - Tue May 13, 2008 11:46 pm
Hi,
i have a linking problem i can't seem to find the cause, someone might lift my blindness.
The file setup is the following:
fifo.cpp, fifo.hpp, ipc,cpp and ipc.hpp
The .cpp's are compiled with g++, their .d and .o are generated in the same /build folder.
In fifo.hpp/cpp a template is declared
The bodies are in the .cpp like
They are used within ipc.cpp and should be created by "new FIFO<int>(32)", but that leads to
c:/devkitPro/projects/NeocronDS/arm7/../shared/source/ipc.cpp:35: undefined reference to `FIFO<int>::empty()'
The fifo.cpp itself is compiled without error or warning.
When examinating fifo.o, with objdump -t there is no symbol that would indicate any class in it.
What am i doing wrong?
i have a linking problem i can't seem to find the cause, someone might lift my blindness.
The file setup is the following:
fifo.cpp, fifo.hpp, ipc,cpp and ipc.hpp
The .cpp's are compiled with g++, their .d and .o are generated in the same /build folder.
In fifo.hpp/cpp a template is declared
Code: |
#ifndef fifo_included #define fifo_included template <class T> class FIFO { private: volatile int * head ; volatile int * tail ; volatile int * maxCount ; volatile T * buffer ; public: FIFO(int size) ; ~FIFO() ; bool Push(T entry) ; T Pop(void) ; int Count(void) ; bool empty(void) ; bool full(void) ; } ; #endif |
The bodies are in the .cpp like
Code: |
template <class T> bool FIFO<T>::empty(void) { // ... } |
They are used within ipc.cpp and should be created by "new FIFO<int>(32)", but that leads to
c:/devkitPro/projects/NeocronDS/arm7/../shared/source/ipc.cpp:35: undefined reference to `FIFO<int>::empty()'
The fifo.cpp itself is compiled without error or warning.
When examinating fifo.o, with objdump -t there is no symbol that would indicate any class in it.
What am i doing wrong?