error: cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string

error: cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string

 报错cannot pass objects of non-trivially-copyable type 'std::string {aka struct std::basic_string<char>}' through '...'

解决方法:

在使用时候 加入c_str()

error: cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string