Hi, I get a beyound-my-level-of-comprehension linking problem with boost and msvc. The problematic code is : typedef const char * (*data2str)( const unsigned char * data, int len ); template<data2str f> char const * data2strWrapperWithList( boost::python::list dataList ) { Apdu apdu = list2apdu( dataList ); return (const char *) ((*f)( apdu.bytes(), apdu.len() )); } [...] // hex2str functions def( "hex2str", data2strWrapperWithList<hex2str> ); def( "block2str", &(data2strWrapperWithList<block2str>) ); [...] Visual reports me a "Unresolved external symbol: char const * __cdecl data2strWrapperWithList( class boost::python::list)" (?...) It links fine if I comment the .def related to these data2str converters. It links fine under linux. Does anybody have any hint ? regards, Philippe ps: please include my in any replay as I am not subscribed. -- Talk less, code more!
--- Philippe Fremy <phil@freehackers.org> wrote:
template<data2str f> char const * data2strWrapperWithList( boost::python::list dataList ) { Apdu apdu = list2apdu( dataList ); return (const char *) ((*f)( apdu.bytes(), apdu.len() )); }
Maybe VC gets confused because "f" does not appear in the signature of your function? I'd try to work around this like so: template<data2str f> struct data2strWrapper { static char const* WithList(boost::python::list dataList) { Apdu apdu = list2apdu( dataList ); return (const char *) ((*f)( apdu.bytes(), apdu.len() )); } }; Then def data2strWrapper<T>::WithList. Ralf __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
participants (2)
-
Philippe Fremy -
Ralf W. Grosse-Kunstleve