Sprintf_s was not declared in this scope
-
These functions are non-standard part of Microsoft's C run time library. Include the relevant headers and build using Microsoft's compiler. You can probably also substitute snprintf.
If you want to make this a Qt question, then you should be using QString. For generic C++ you should be using std::string.