views:

88

answers:

1

Hello!

This isn't a duplicate of http://stackoverflow.com/questions/531502/vc-resources-in-a-static-library because it didn't help :)

I have a static library with TWO .rc files in it's project. When I build my project using the Debug configuration, I retrieve the following error (MSVS2008):

fatal error LNK1241: resource file res_yyy.res already specified

Note, that this happens only in Debug and Release library builds without any troubles. The command line for Resources page in project configuration looks the same for every build:

/fo"...(Path here)/Debug/project_name.res"
/fo"...(Path here)/Release/project_name.res"

and I can't understand what's the trouble. Any ideas?

UPDATE

I don't know why this happens, but when I turn "Use Link-Time Code Generation" option on the problem goes away.

Could somebody explain why does this happen? I feel like MS-compiler is doing something really strange here.

Thanks.

+1  A: 

Solved this problem by setting EXACTLY ONE .res output file in the settings. I'm not actually sure why it was ok in Release mode though.

HardCoder1986