简体   繁体   中英

working directory win32 visual studio

I have createprocess witch lpCurrentDirectory is Set to NULL . I have changed my working directory to ..\\Debug in property window. 在此处输入图片说明

Then create process finds .exe file and program works without problems. Then I push my program with git to server. Then I create folder and clone from server that program. Problem is that when I or any other person clones that program working directory changes to default. 在此处输入图片说明

Then createprocess can't find .exe file. Most important thing here is that program must run on other computers without any modifications. So my questions would be:

  • How can I make my working directory permanent?
  • if It can't be done what other options to this problem i have? And how to implement them?

Most important thing is that paths can't be written like this L"G:\\CppProjects\\ConsoleApplication1" because it won't work from other directory or other computers without small modifications. Any ideas are wellcome.

The Debugging settings for Visual Studio projects are considered user-specific, not project-specific. This is because these settings very often contain paths which are only guaranteed to exist on the workstation which sets them up. By design and by default, these settings are not committed to source control.

You CAN share these things by putting the whatever.vcxproj.user file (from the same directory as whatever.vcxproj ) into source control. I wouldn't recommend doing that, however, because this file contains not only debugging settings, but also other workstation/user-specific settings that you may find problematic to share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM