Why this can`t compler?
-
:( Who can help me? #include "stdafx.h" template struct S { int qqq; friend bool operator< (const S&t1,const S&t2); }; template bool operator< (const S&t1,const S&t2) { return true; } int _tmain(int argc, _TCHAR* argv[]) { Ss; Ss2; bool uintb = s2 const &,struct S const &)" (??M@YA_NABU?$S@H@@0@Z) ,该符号在函数 _main 中被引用 Debug/TestSTL.exe : fatal error LNK1120: 1 个无法解析的外部命令 ~_~
-
:( Who can help me? #include "stdafx.h" template struct S { int qqq; friend bool operator< (const S&t1,const S&t2); }; template bool operator< (const S&t1,const S&t2) { return true; } int _tmain(int argc, _TCHAR* argv[]) { Ss; Ss2; bool uintb = s2 const &,struct S const &)" (??M@YA_NABU?$S@H@@0@Z) ,该符号在函数 _main 中被引用 Debug/TestSTL.exe : fatal error LNK1120: 1 个无法解析的外部命令 ~_~
This is addressed in the C++ FAQ Lite: [34.15] Why do I get linker errors when I use template friends?[^] --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Magnae clunes mihi placent, nec possum de hac re mentiri.
-
This is addressed in the C++ FAQ Lite: [34.15] Why do I get linker errors when I use template friends?[^] --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Magnae clunes mihi placent, nec possum de hac re mentiri.