我正在尝试使用来自 QtMultimedia 的 QSoundEffect。我已经包含了这样的文件:
#include <QtMultimedia/QSoundEffect>
并在我的项目中使用了 QSoundEffect。
当我尝试在此之后编译我的项目时,我收到 LNK2019 错误:
1>chatwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QSoundEffect::QSoundEffect(class QObject *)" (__imp_??0QSoundEffect@@QEAA@PEAVQObject@@@Z) referenced in function "public: __cdecl ChatWindow::ChatWindow(class QWidget *)" (??0ChatWindow@@QEAA@PEAVQWidget@@@Z)
1>chatwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QSoundEffect::~QSoundEffect(void)" (__imp_??1QSoundEffect@@UEAA@XZ) referenced in function "int `public: __cdecl ChatWindow::ChatWindow(class QWidget *)'::`1'::dtor$3" (?dtor$3@?0???0ChatWindow@@QEAA@PEAVQWidget@@@Z@4HA)
1>chatwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QSoundEffect::setSource(class QUrl const &)" (__imp_?setSource@QSoundEffect@@QEAAXAEBVQUrl@@@Z) referenced in function "public: __cdecl ChatWindow::ChatWindow(class QWidget *)" (??0ChatWindow@@QEAA@PEAVQWidget@@@Z)
1>mainwidget.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QSoundEffect::play(void)" (__imp_?play@QSoundEffect@@QEAAXXZ) referenced in function "private: void __cdecl MainWidget::process_received_forever(void)" (?process_received_forever@MainWidget@@AEAAXXZ)
如何告诉 Visual Studio QtMultimedia 相关文件的存在?Qt 包含和库路径由 Visual Studio 中的 Qt VS Tools 扩展处理,所以我有点困惑。