Re: is there a way to tell the compiler that an object exists in a
different translation unit?
On Nov 22, 7:04 pm, aaragon <alejandro.ara...@gmail.com> wrote:
I have this problem that is driving me crazy! I have a typedef for a
singleton object in a file "fileA.h", then I try to use that object in
"fileB.h" and then the compiler says that the object has not been
declared! It doesn't matter what I do, the problem won't go away. I
#include the header file where the typedef is declared, I tried
forward declaration, it just won't go away. The typedef in filaA.h
looks like this:
typedef Loki::SingletonHolder< NodeManagerImpl<NodeBase, std::string >
Then, I try to use this in fileB.h:
That *looks* like executable code. If so, it probably doesn't
belong in a header.
Any ideas on how to solve this?
NodeManager is a typedef. It must be present in all translation
units which use it. Which means including fileA.h where ever
you use it.
I wonder about one thing. You're at a level where you don't
even know something this fundamental, and you're trying to use
Loki. I'd suggest learning the basics of the language first,
and then tackling Loki. Or Boost, or any other additional
libraries (but Loki is probably more complex than most).
James Kanze (GABI Software) email:email@example.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34