![](/img/trans.png)
[英]Invalid operands of types ‘const char [8]’ and ‘const char*’ to binary ‘operator+
[英]How to resolve “ invalid operands of types 'const char [ ]' and 'const char*' to binary 'operator+' ”
我使用Qt Creator和以下代码:
string execpath = "";
execpath += (QCoreApplication::applicationDirPath()).toStdString();
WinExec("ffmpeg -f dshow -t 32 -i audio=\"virtual-audio-capturer\" -y "+(execpath.c_str())+"\\sound.mp3", SW_HIDE); // Loopback captured in sound.mp3
在第3行产生此问题:
类型'const char [60]'和'const char *'的无效操作数为二进制'operator +'
怎么解决呢?
您将需要类似:
execpath += (QCoreApplication::applicationDirPath()).toStdString();
std::string cmd = "ffmpeg -f dshow -t 32 -i audio=\"virtual-audio-capturer\" -y "
WinExec((cmd +execpath +"\\sound.mp3").c_str(), SW_HIDE);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.