【发布时间】:2013-10-12 16:04:05
【问题描述】:
在 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)
我是否需要告诉 QT Shell32.dll 库在哪里或 shlobj.h 的什么地方?
【问题讨论】: