-
June 9th, 2003, 08:32 AM
#1
Lnk1179
Hello folks.
I'm facing an annoying problem. I have a console app, pretty complicated, admitely. However, it compiles fine, but gives me a linking error:
main.obj : fatal error LNK1179: invalid or corrupt file: duplicate comdat "?for_each@std@@YAP6AXPAD@ZViterator@?$list@PADV?$allocator@PAD@std@@@1@1P6AX0@Z@Z"
The peculiar part is that I get the error in debug mode only. I am using std::for_each in one place only in my code, like this:
Code:
std::for_each(mem_.begin(), mem_.end(), kill);
//where mem_ is
std::list<char *> mem_;
// ans kill() is
static void kill(char *p){delete [] p;}
I have searched MSDN without finding any info that was relevant for me. I compared the compiler/linker settings (VC++6.0SP5) one by one and the only differencies are the normal ones (that differentiate debug from release).
Btw: I get the error regardles if I use the Dinkumware STL (that came with VC6) or STLPort (version 4-5-3)...
Any thoughts, suggestions etc greatly appreciated.
TIA,
-
June 9th, 2003, 08:44 AM
#2
There are a couple of links if you search for comdat in codeguru...or maybe you already did that...
In this one, the OP had to re-install VC..
http://www.codeguru.com/forum/showth...ghlight=comdat
-
June 9th, 2003, 08:44 AM
#3
I found a solution. Project->Settings->C++ tab, Debug cathegory: Inline function expansion: change from 'None' to 'Only _inline'.
The credit goes to the author of this webpage
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|