Re: warning LNK4221 with VS2005 but not with VS2003 by Carl
Carl
Mon Oct 23 13:15:02 CDT 2006
"Eric" <clement.eric@gmail.com> wrote in message
news:1161625254.986595.172440@h48g2000cwc.googlegroups.com...
> Eric wrote:
>> Hi,
>>
>> I get this warning
>>
>> yywcsskp.obj : warning LNK4221: no public symbols found; archive member
>> will be inaccessible
>>
>> when I compile a static library with VS2005. But the same project with
>> VS2003 doesn't give this warning.
>>
>> And this warning seem to cause me problem when I want to link an
>> application with this library. I got some unresolved external symbol
>> like this
>>
>> my_lexer.obj : error LNK2001: unresolved external symbol "public:
>> virtual void __thiscall yl::yywlexer::yyerror(unsigned short const *)"
>> (?yyerror@yywlexer@yl@@UAEXPBG@Z)
>>
>> Can somebody help me ? Is it a VS2005 known bug ?
It's likely the result of fixing a bug in 2003, but since you haven't posted
any code, it's impossible to know for sure.
How is yl::yywlexer::yyerror declared? How is the class yl::yywlexer
declared?
> and why the size of the generated library is very different between
> VS2005 and VS2003 ?
>
> 2,418 KB (VS2005) vs 1,679 KB (VS2003)
Probably larger symbol information in the 2005 library. The code itself
shouldn't be larger unless it's a debug build - the 2005 compiler includes
more runtime checks in debug builds than 2003 did.
-cd