我看了一遍,甚至发现了一些像Why does CreateSymbolicLink() succeed, but the generated link is invalid这样简单的东西。然而,我的错误
main.cpp:179: error: 'CreateSymbolicLink' was not declared in this scope
以下是该区域的代码:
if (j > 1)
{
for (i = 0; i < m.size(); i++)
{
if (strcmp(filename, m[i].name) != 0)
{
unlink(m[i].name);
#ifndef _WIN32
symlink(filename, m[i].name);
#else
CreateSymbolicLink(m[i].name, filename, 0x0);
#endif
}
}
#ifndef _WIN32
sync();
#endif
//printf("Found %lu files the same as %s\n", j, filename);
}
是的,包含了windows.h。
有什么想法吗?