【问题标题】:PathFileExists causes Linker error 2028/2019 [duplicate]PathFileExists 导致链接器错误 2028/2019 [重复]
【发布时间】:2015-01-13 10:22:12
【问题描述】:

按照此处的说明尝试 PathFileExists:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773584%28v=vs.85%29.aspx
导致链接器错误 LNK2028 和 LNK2019。
这是我的代码:

char buffer1[] = "C:\\temp\\index.xml";
char *lpStr1;
lpStr1 = buffer1;

int retval;

retval = PathFileExistsA(lpStr1);
if (retval == 1 )
{
    this->lbl_stat->Text = "File found!";
}else{
    this->lbl_stat->Text = "File not found!";
}

【问题讨论】:

  • 将 Shlwapi.lib 添加到链接器依赖项列表中。

标签: c++ visual-c++ visual-studio-2008 windows-7-x64


【解决方案1】:

正如 MSDN 页面底部所解释的,您必须将对 shlwapi.lib 的依赖项添加到项目属性中(在链接器设置下查找“附加库”或类似内容)。

【讨论】:

    猜你喜欢
    • 2010-12-11
    • 2013-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-01
    • 1970-01-01
    相关资源
    最近更新 更多