![]() |
|
Namespace problems |
raycrasher
Member #6,683
December 2005
|
Take the following:
The problem is, I get plenty of compile errors - "Undefined: Engine" in graphics.h and/or "Undefined: Graphics" in engine.h. I finally solved the problem by limiting the contents of my namespaces to functions and variables, but no class/struct defs. I'm just wondering what caused the errors. |
aj5555
Member #9,033
September 2007
|
circular dependancies. which means you have a bad design. circular dependancies -> which came first chicken or the egg? |
OnlineCop
Member #7,919
October 2006
![]() |
aj5555 said: circular dependancies -> which came first chicken or the egg? The egg, of course! With the "evolution theory", the last "mutation" of the chicken's species was transferred into the now-layed egg. The egg, being a mutant of the "almost chicken" parent, can now officially be called "a chicken". Once it is hatched, it can be considered a full-fledged chicken, and when it mates with the "almost a chicken" species, natural selection allows it to keep its "chicken" classification and life is good. Colonel Sanders is soon spotted on the horizon.
|
Neil Black
Member #7,867
October 2006
![]() |
Quote: Colonel Sanders is soon spotted on the horizon. And almost-chicken tells chicken, "Good luck, loser!" and runs off leaving chicken to its horrible (but delicious) fate. Ironically, almost-chicken was then eaten by a saber-toothed tiger, which sucks because, had almost-chicken survived, we would have had a food source that did not, in fact, taste like chicken.
|
Bob
Free Market Evangelist
September 2000
![]() |
Simply forward-declare your classes. // In engine.h namespace Graphics { class Camera; } Hope this helps. -- |
raycrasher
Member #6,683
December 2005
|
Yes, you're right. It was a crappy design, so I overhauled the code, used singletons for Engine and Graphics and whatnot. It compiles okay now, and looks more readable, too. Thanks. Now, if I can only make OpenLayer run faster on my crappy S3 ProsavageDDR... |
GullRaDriel
Member #3,861
September 2003
![]() |
Quote: Now, if I can only make OpenLayer run faster on my crappy S3 ProsavageDDR... You can not ask a donkey to run as fast as a horse. "Code is like shit - it only smells if it is not yours" |
raycrasher
Member #6,683
December 2005
|
Oh well. New card, then. Or strap a rocket booster to teh donkey. |
|