当我使用控制台子系统时,为什么我的工作目录更改为 C:\Windows\System32 [英] Why does my working directory change to C:\Windows\System32 when I use a Console subsystem

查看:77
本文介绍了当我使用控制台子系统时,为什么我的工作目录更改为 C:\Windows\System32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS2013 中使用 SDL,我试图从我的工作目录应该使用相对路径的文件夹加载图像.这是 .vcxproj 文件所在的位置.但是我发现工作目录不是它应该是的文件夹,它实际上在 C:\Windows\System32 中.我已经意识到只有当我转到链接器、系统然后将子系统更改为 CONSOLE 时才会出现这种情况.在 WINDOWS 子系统中,它使用正确的工作目录.为什么会发生这种情况,我该如何解决?

I'm using SDL in VS2013 and I'm trying to load an image from the folder that my working directory should be using a relative path. Which is where the .vcxproj files are. However I discovered that the working directory is not the folder it should be, it is actually in C:\Windows\System32. I have realised that this is only the case when I go to linker, system and then change the subsystem to CONSOLE. In a WINDOWS subsystem it uses the correct working directory. Why is this happening and how do I fix it?

我认为这可能与使用位于 system32 文件夹中的 cmd.exe 的 VS2013 有关,但我不能确定,即使是这种情况也不知道如何修复它.

I think it may have something to do with VS2013 using cmd.exe which is in the system32 folder but I cannot be certain and would not know how to fix it even if that is the case.

推荐答案

嗯...我想我从来没有遇到过这个问题,我总是用控制台窗口写.您是否尝试过创建一个新项目来查看是否可能意外或其他原因在您的属性中设置了某些内容?我会尝试一下,或者重新安装 SDL ..?这很奇怪,抱歉我没有更好的建议!

Hmm...I don't think I've ever had that problem, and I always write with the console window. Have you tried just making a new project to see if maybe something got set in your properties by accident or something? I would give that a try, or maybe re-install SDL..? That's weird, sorry I don't have better advice!

这篇关于当我使用控制台子系统时,为什么我的工作目录更改为 C:\Windows\System32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆