在 Qt 中,我收到许多 Windows 功能的未解决的链接器错误,例如SHGetKnownFolderPath
#include "pip.h"
#include "ui_pip.h"
#include <QFileDialog>
#include <QMessageBox>
#include <Objbase.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <QtNetwork/QHostAddress>
#include <shlobj.h>
#include <windows.h>
#include <Shlwapi.h>
#include <Knownfolders.h>
功能:
PWSTR appData = 0;
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Desktop,
0,
NULL,
&appData)))
{
wcout << appData << endl;
}
链接器错误:
pip.obj : error LNK2019: unresolved external symbol _SHGetKnownFolderPath@16
referenced in function "private: void __thiscall pip::on_submitButton_clicked(void)"
(?on_submitButton_clicked@pip@@AAEXXZ)
我需要告诉 QTShell32.dll
图书馆在哪里shlobj.h
吗?