Hi,
I'm trying to use a library that has some template classes, and thus I have some classes of my own now that inherit these templates. This means I end up having to include the whole code of my template classes in headers, or else I end up with missing objects at linking time. When I include the whole class in my headers, the compiler then no longer gets around classes referencing classes that reference themselves because of the incomplete type issues. I tried making different header files, and this simply got me redefinition errors. Does anyone have some suggestions of how to get around this problem? Normally just making a pointer visible in header files and referencing the functions in the *cpp files is the only solution I found so far, but templates seem to exclude this from my options.
Thanks in Advance,
Sean
When I include the whole class in my headers, the compiler then no longer gets around classes referencing classes that reference themselves because of the incomplete type issues.
g++-4.0 -c -g -w -MMD -MP -MF build/Debug/GNU-MacOSX/CDrawSequence.o.d -o build/Debug/GNU-MacOSX/CDrawSequence.o CDrawSequence.cpp
CDrawSequence_fwd.h:5: error: 'CDrawSequence' was not declared in this scope
CDrawSequence_fwd.h:5: error: template argument 2 is invalid
CDrawSequence_fwd.h:5: error: template argument 4 is invalid
CDrawSequence_fwd.h:5: error: expected initializer before 'mulimapIterator_TYPE'
CFASTA.h: In member function 'void CFASTA<SelectableItemType>::findLassoItemsInArea(juce::Array<Type, juce::DummyCriticalSection>&, int, int, int, int)':
CFASTA.h:256: error: 'mulimapIterator_TYPE' was not declared in this scope
CFASTA.h:256: error: expected `;' before 'i'
CFASTA.h:256: error: 'i' was not declared in this scope
make[2]: *** [build/Debug/GNU-MacOSX/CDrawSequence.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 22s)
g++-4.0 -c -g -w -MMD -MP -MF build/Debug/GNU-MacOSX/CDrawSequence.o.d -o build/Debug/GNU-MacOSX/CDrawSequence.o CDrawSequence.cpp
CDrawSequence_fwd.h:7: error: 'CDrawSequence' was not declared in this scope
CDrawSequence_fwd.h:7: error: template argument 2 is invalid
CDrawSequence_fwd.h:7: error: template argument 4 is invalid
CDrawSequence_fwd.h:7: error: expected initializer before 'mulimapIterator_TYPE'
CFASTA.h: In member function 'void CFASTA<SelectableItemType>::findLassoItemsInArea(juce::Array<Type, juce::DummyCriticalSection>&, int, int, int, int)':
CFASTA.h:256: error: 'mulimapIterator_TYPE' was not declared in this scope
CFASTA.h:256: error: expected `;' before 'i'
CFASTA.h:256: error: 'i' was not declared in this scope
make[2]: *** [build/Debug/GNU-MacOSX/CDrawSequence.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 22s)