【发布时间】:2016-11-27 07:01:27
【问题描述】:
(Visual Studio 2010 / Visual C++ / Windows 7)
example.cpp:
#include <Shlobj.h>
#pragma comment (lib, "Shell32.lib")
...
void example()
{
SHGetKnownFolderPath(...) // undefined
}
我正在按照documentation 以及我在其他线程中看到的内容做所有事情,但它仍然不起作用。
【问题讨论】:
-
什么意思?编译代码时会发生什么?当你运行它?为什么不将参数传递给它期望的函数?尝试向我们展示您的实际代码而不是伪代码。
-
确切的错误是什么?您可能没有指定 Vista+。
-
@sgar91,我从经验中知道包括 .lib 是有效的。
-
@chris,错误 C3861:'SHGetKnownFolder':找不到标识符
-
请永远不要说“它不起作用”。完整描述故障模式,包括逐字错误消息。
标签: c++ c visual-studio-2010 visual-c++ known-folders