From: Gehua Y. <yan...@gm...> - 2012-04-16 21:46:10
|
Hi Antonio, I am having a small trouble compiling with the new vul_arg.h. Visual Studio raised a warning: Warning 75 warning C4661: 'vul_arg<T>::required_option_type vul_arg<T>::is_required' : no suitable definition provided for explicit template instantiation request c:\vxl\src\core\vul\vul_arg.h 198 and eventually a linking error: Error 495 error LNK2001: unresolved external symbol "public: static struct vul_arg<int>::required_option_type vul_arg<int>::is_required" (?is_required@?$vul_arg@H@@2Urequired_option_type@1@A) C:\vxl\bin-vc10-x64\core\vul\tests\test_arg.obj A fix is to add this line to initialize the static member variable outside of class scope: template <class T> typename vul_arg<T>::required_option_type vul_arg<T>::is_required; // init However, I do not like this fix as it may potentially result in duplicate symbol error at linking stage if two different source files use vul_arg with the same type. I would propose to use a slightly different version: static required_option_type is_required() { return required_option_type(); } Let me know whether you are okay with this solution. Best Regards, Gehua Yang Regards, Gehua Yang On Fri, Mar 30, 2012 at 10:52 AM, Antonio Garrido Carrillo <A.G...@de...> wrote: > > > Ian, > > I agree... not annoying enough, so, perhaps I am the one. Give me some days and I will > commit some code to include required arguments... > > Thanks > Antonio. > > > -- |