[Solved] C + + compile Error: error: default argument given for parameter 3

1. error: default argument given for parameter 3 of ‘void split(const string&, std::vector<std::__cxx11::basic_string<char> >&, char)’ [-fpermissive]
void split(const std::string &s, std::vector<std::string> &sv, const char flag = ‘ ‘)
^
In file included from /home/zhouying/lcl/test/FotaService/src/util.cpp:5:0:
/home/zhouying/lcl/test/FotaService/include/util.h:6:6: note: previous specification in ‘void split(const string&, std::vector<std::__cxx11::basic_string<char> >&, char)’ here
void split(const std::string &s, std::vector<std::string> &sv, const char flag = ‘ ‘);

 

Cause: The third formal parameter in the header file util.h is set to the default value, and the third formal parameter in the function definition in util.cpp is set to the default value, resulting in preservation, delete the third formal parameter default value in the function definition in util.cpp

Read More: