Click here to Skip to main content
15,917,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello people.
I am working on a project where I have to call some functions from a .lib file.The .lib file was compiled in Visual Studio 2003 and I am making the function calls from the .lib file from Visual Studio 2003 as well. When linking, I am getting this error nafxcwd.lib(objcore.obj) : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '' . I have tried the /Gy and /H linker options but to no avail. Can someone please help me debug this error.I have only the .lib file and the .h file for the library. Recompiling the .lib file is not an option.The functions in the .lib file are static functions contained in a class.
Thanks in advance.
Updated 21-Dec-10 16:52pm
cariolihome 17-Jan-11 16:26pm    
If You can't recompile lib, try locate duplicate comdat manually (e.g. using disassembler)

1 solution

One of the problems that can be encountered with static library projects, is when you go to link with them, in another project of your own, the compile settings for your project need to be complimentary to the settings that were used to produce the static library. Since you no longer have the original source for the static library, you probably also don't know what compile settings were used to produce it. You may have to adjust your own compile options, one at a time in order to find the setting that will at least be complimentary and allow the linking to occurr. For example, one such setting is whether to use the muti-threaded or the single threaded C runtime. Code optimizations are another. Also even though you are using VS 2003, if it is at a different service pack level than was use to produce the static library, that too might be an issue.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900