Re: [GD-General] Practical Game Structure.
Brought to you by:
vexxed72
From: Kent Q. <ken...@co...> - 2002-01-14 03:55:01
|
We use a similar structure, where different libraries are dependent on each other, especially including util. But I consider a multiple definition warning to be an error and eliminate it. We don't have this problem. Just because a library is dependent on another library doesn't mean that the code gets included multiple times. I'm guessing that you're defining objects in include files instead of in code. If you have something like this: //-----idnumber.h------ class IdNumber { public: static int id = 1; }; change it to this: //-----idnumber.h------ class IdNumber { public: static int id; }; //-----idnumber.cpp------ #include <util/IdNumber.h> int IdNumber::id = 1; You *don't* want that definition to show up more than once when you link. Kent Chris Brodie wrote: > > In the beginning of my current project I attempted to create structure within my project by using static libs. However as the project grew and the number of static libs grew my grand plan of structure has become a bit wobbly. > > For example: > > OpenGL Renderer is dependent on Common, Graphics and Renderer. Graphics is dependent on Common. Renderer is dependent on Application, Graphics, Video and Resource Manager. Application, Video and Resource Manager are all dependent on Common. Common includes things like expat and zlib + ~50 other classes. > > >From this you can assume that just about everything uses common. The problem is that since common is included and included again and again I seem to be getting linker warnings about multiply defined symbols. I've been looking for an answer to this for months, not because I get a few warnings and it looks messy, rather I get 4000 warnings and it takes a -long- time for them to be displayed, long enough that it's probably doubling my build time. > > Originally I went with this structure to reduce the amount of unused code that gets linked to all my DLL's (one for each renderer, mixer, input system etc). > > I'm happy to hear from anyone who can either suggest a better structure or knows how to turn a linker warning off. I'm using .NET but this problem was with me under VC6 too. > > Many thanks > > Chris > > NOTICE > This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank. > > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general -- ----------------------------------------------------------------------- Kent Quirk | MindRover: "Astonishingly creative." Game Architect | Check it out! ken...@co... | http://www.mindrover.com/ _____________________________|_________________________________________ |