RE: [GD-Windows] operator delete linker hell
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2002-06-22 19:26:30
|
Some headers pull in libraries by using #pragmas. It's really annoying. I find that the One True Way (tm) to fix these problems is to use the "ignore default libraries" option (/NODEFAULT on the cmd line) and to specify all libraries you want, yourself. Also beware that if you use the Microsoft implementation of STL, then some deallocations are concretely implemented in the DLL for STL functions, whereas allocations happen in template code that gets expanded into your app. If you use custom new/delete, this doesn't work very well, because the MS STL DLL is hard-coded to use Microsoft's operator delete. Cheers, / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Brian Hook > Sent: Saturday, June 22, 2002 10:25 AM > To: gam...@li... > Subject: [GD-Windows] operator delete linker hell > > > I have my own globally defined operator delete and new which > allocate from > a custom heap, do memory tracking, etc. etc. Works great in my GUI app, > not a problem. > > Now I'm using my same libraries with a console app, and I'm getting a > linker error saying that operator delete() is multiply defined. After > doing a lot of Google and KB searching, it looks like a link > order problem, > but I've tried everything suggested on-line to fix it. > > The specific suggestions are to remove libcmtd.lib from the default libs > (i.e. put it in ignore libs) and then add it back in the object/library > modules setting in MSVC6. I've tried that to no avail. I've done > /verbose:lib to see the output of the linker, but it's pretty much > meaningless to me -- it shows me what it's searching, but there doesn't > seem to be anything else relevant in there (and it searches the same libs > multiple times). > > So, any ideas what else I can try to make this link. This is > _supposed_ to > work, and it has worked for me on my other projects, but for some reason > it's just getting pissy with this. I've double checked to make sure I'm > linking to the correct libraries consistently (LIBCMTD.LIB), etc. > > Thanks, > > Brian > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |