code::blocks can't create files

9.5k views Asked by At

I just barely installed Code::Blocks so that I can learn how to program in fortran with a real IDE (with debugging and other fun things). But I'm running into a puzzling problem while trying to get it to work--Code::Blocks seems to be unable to create any files at all.

Info: I'm running Linux Mint 17 and built Code::Blocks from source (version 13.12 for Debian, which seemed like the closest I could get). When I try to create a new project, it gives the following error for every single file in the project:

Warning
Couldn't save project path/filename
(Maybe the file is write-protected?)

This is when I run code::blocks from the terminal as a super user. When I simply run Code::Blocks without super user, I get the following:

Error
Couldn't create the project directory
path/

No idea what's going on here, and I can't find a similar question. Help?

5

There are 5 answers

0
Josh On

One possible cause for your problem is that you specified an invalid path to a new project when starting one.

If you see "Invalid file path" in the "Resulting filename field", you generally should not hit "Next".

Below is a screenshot showing how your dialog should look when you've filled in the file path properly: Example of a valid project file path

In case anyone is curious, I overlooked this initially in CodeBlocks 17.2 on Windows 10 before finding this question and posting this answer.

1
Vipul Krishna Mathuria On

I finally found the answer. Do not create new file or new project in C

Try to create in other disks. Folders situated in C are protected folders

and you can save your file or save as file just fine

0
Kanchan Benal On

I was facing the same problem but after following this below procedure I was able to run the program Procedure: In code-block go to the Setting, click on Tool chain executable then click on auto detect

This will solve the problem

0
Kynan Jones On

Linux mint 19.1 with a fresh install of Code::Blocks 16.01.

I was getting the same message as below when trying to create a project and the dialog box never showed the "invalid path" message.

"Couldn't create the project directory: /home/mydir/Code/CppTraining/HelloWorld/"

I found I was able to create the path after I removed one level of subfolders. It seems code::blocks doesn't like project paths to have more than one or two levels of subfolders?

0
user2470057 On

If you're flipping back and forth from Linux to Windows, this problem may occur and it's extremely frustrating as a Linux user to debug.

Windows doesn't understand that the tilde "~/" means your home folder, so you actually have to type "C:\Users\<yourusername>\<path>" , instead of just typing "~/<path>"

Hope this helps anyone that has run into this.