C++ 代码块无法创建输出目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14550645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Codeblocks cannot create output directory
提问by
I'm using Code::Blocks 12.11 in Widnows XP. I've been learning C++, so I haven't been working on any specific projects, just individual files. I'm trying to debug one of these files, but found from this questionthat I needed to be in a project in order to debug. So, I created a project for all of my C++ practice files. Now, when I try to debug (or run) the program, Code::Blocks gives me this error: "Can't create output directory bin\Debug.
我在 Widnows XP 中使用 Code::Blocks 12.11。我一直在学习 C++,所以我没有在任何特定的项目上工作,只是在单个文件上工作。我正在尝试调试其中一个文件,但从这个问题中发现我需要在一个项目中才能进行调试。所以,我为我所有的 C++ 练习文件创建了一个项目。现在,当我尝试调试(或运行)程序时,Code::Blocks 给了我这个错误:“无法创建输出目录 bin\Debug。
When I remove the file from the project it still gives me this error. What can I do to try to fix this so that the program can run and debug?
当我从项目中删除文件时,它仍然给我这个错误。我能做些什么来尝试解决这个问题,以便程序可以运行和调试?
Additional information:
附加信息:
In Settings>Compiler>Global Compiler Settings>Compiler Settings>Compiler Flags, I have enabled "Produce debugging symbols [-g]". This is something that a lot of other resources I've checked have mentioned.
在设置>编译器>全局编译器设置>编译器设置>编译器标志中,我启用了“生成调试符号[-g]”。这是我检查过的许多其他资源都提到过的。
Also, under Debug>Active Debuggers, I've tried using both debuggers, both of which produce the same error message.
此外,在 Debug>Active Debuggers 下,我尝试使用两种调试器,它们都产生相同的错误消息。
采纳答案by turnt
Why don't you try to remove the entire project directory, create an empty project and then place the source files one by one into the project. Beware if you have a main()
method in each of your source files.
不如试试把整个工程目录去掉,创建一个空工程,然后把源文件一个一个的放到工程里。如果main()
每个源文件中都有一个方法,请注意。
回答by Atharva Mandrekar
Well, a friend of mine was getting the same error. So I decided to check it out.
好吧,我的一个朋友也遇到了同样的错误。所以我决定去看看。
I my case, the error was because of the account user name.
我的情况是,错误是因为帐户用户名。
When I checked, the output directory while creating the file and the one in the error being shown, were different.
当我检查时,创建文件时的输出目录和显示的错误中的目录不同。
When I checked, I created an user account name with "$aaa$", and I got the same error.
当我检查时,我用“$aaa$”创建了一个用户帐户名,但我得到了同样的错误。
and I noticed that the error was because of the "$" sign. (Probably).
我注意到错误是因为“$”符号。(大概)。
So, I guess the problem is with the user name. Try changing the user name to something simple.
所以,我想问题出在用户名上。尝试将用户名更改为简单的名称。