Open rimmartin opened 2 years ago
Currently calling the winbase CreateSymbolicLinkW makes the symlink but create_directory_symlink doesn't. SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE is set to 0x02
#ifdef __WIN32__
CreateSymbolicLinkW(localLinkPath.c_str(), localPath.c_str(), SYMBOLIC_LINK_FLAG_DIRECTORY|SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE);
#else
try{
std::filesystem::create_directory_symlink(localPath, localLinkPath);
}
catch(std::filesystem::filesystem_error& ex){
std::throw_with_nested( std::runtime_error("Couldn't create symbolic link " + localLinkPath.string()) );
}
#endif
Cloned gcc and will look deeper
Been attempting to use "g++.exe (Rev5, Built by MSYS2 project) 11.2.0" to build a program using https://en.cppreference.com/w/cpp/filesystem/create_symlink and create_directory_symlink. Anyone use these successfully? I can get powershell 7 commands to make a symlink
I've set developer mode for a try. Installed gpedit.msc and set the Computer Configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment → Create symbolic links
for user and admin.
But the program continues to hit
also tried the code example at https://en.cppreference.com/w/cpp/filesystem/create_symlink
What windows policy could be blocking?
I've set -DSYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE=2 for compiles to see if it has a good effect but nada.