std::string get_path( void ) { return m_devicePath; }
Debug output:
hid_device.h(37) : error C2664: >’std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::>_Has_debug_it)’ : cannot convert parameter 1 from ‘unsigned long’ to >’std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it’
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
Constructor for struct ‘std::basic_string<_Elem,_Traits,_Ax>::_Has_debug_it’ is declared ‘explicit’
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
Wrong includes. You should have
#include <string>, not#include <string.h>or any other variation at the top of the file.m_devicePathis anunsigned long(doubt that) and can’t be directly converted tostd::string.Use
std::to_string()(C++11):or a
stringstream(C++03) to convert theunsigned longto astd::string: