How do I set the working directory to the “solution directory” in c++?

后端 未结 5 1203
生来不讨喜
生来不讨喜 2020-12-30 02:01

I want to set the current directory to the solution diretory/configuration name. How do I do that? Can I use the global variables somehow?

Edit: I am trying to read a

5条回答
  •  猫巷女王i
    2020-12-30 02:35

    In Visual Studio 2010:

    1. Go to the project properties (rigth click on the project name in the Solution Explorer, then Properties on the pop up menu).
    2. Then, under Configuration Properties / Debugging, set Working Directory to $(SolutionDir)$(Configuration)\.

    Full list of available macros (on docs.microsoft.com) : Common macros for MSBuild commands and properties

提交回复
热议问题