Code::Blocks

User forums => Using Code::Blocks => Topic started by: hundred4ever on October 11, 2017, 01:29:06 am

Title: SOLUTION for "ERROR: can't save file" - C++ - Leave your solutions!
Post by: hundred4ever on October 11, 2017, 01:29:06 am
Hey.

Using codeblocks 16.01 mingw setup, I came across the error where I modified my source file and then tried to save it. No dice. Code::Blocks (CB) wouldn't save any changes.

Trying to find a workaround, as I'm a new user, I opened my .cpp file in Notepad++. It opened, but when I went to save it, it said I didn't have permissions. The file was read-only. So, I figure it was also a permissions problem in CB.

Anyway, I fixed it by making sure the source file was created in the project. After copying my code, I deleted my original source file from my desktop and did the following:

INSTRUCTIONS

After opening CB > Make sure the project you're working on is open > Highlight that project (on your left, it has a CB icon) > File > New > Empty file > Go through the wizard, file name should have extension .cpp (ex. HelloWorld.cpp) > SAVE > This creates a C++ source file within your project, which should open automatically.


This source file will be available to your left, under Sources.

Paste your code, and it should save!


NOTE: If you don't add the .cpp extension, you'll create a .c file, which is... regrettable if you're a C++ dev, lol.


Good luck, all!

Hope this helps.

Leave a solution or comment.
Title: Re: SOLUTION for "ERROR: can't save file" - C++ - Leave your solutions!
Post by: rbatoon on January 09, 2018, 09:39:31 pm
Tried latest version and version 16; using windows pro 64 bit computer (version 10.0.16299.125); can't save any changes; anyone else have any ideas
Title: Re: SOLUTION for "ERROR: can't save file" - C++ - Leave your solutions!
Post by: BlueHazzard on January 11, 2018, 09:24:30 pm
http://forums.codeblocks.org/index.php/topic,22241.0/all.html