工作目录-解决方案
如何使工作目录成为“解决方案目录”但不是通过属性,而是通过代码?
我在窗户上工作。
How do I make the working directory the "solution directory" but not through the properties, but through the code?
I'm working in windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的意思是要找到其中包含 .sln 文件的目录并使用它,那么 C++ 中没有 .sln 或 Makefile 之类的概念,或者构建中实际使用的任何其他内容编译您的项目的过程。
这个概念是,您正在构建机器代码以在没有特定运行时环境的情况下运行,尽管它可能需要在运行时查找其他库。
您可以对 .sln 文件的路径或名称进行硬编码,然后让您的程序在文件系统中搜索它(如果找到),但这仅是全部。
If you mean you want to find the directory that has a .sln file in it and work with it, there is no concept in C++ of such a thing as a .sln or a Makefile, or anything else really that was used in the build process to compile your project.
The concept is that you are building machine code to run without a specific runtime environment, although it may need to find other libraries at runtime.
You could hard-code the path in, or the name of the .sln file and then let your program search the filesystem for it in case it finds it, but that's just about all.