User forums > Using Code::Blocks

SOLUTION for "ERROR: can't save file" - C++ - Leave your solutions!

(1/1)

hundred4ever:
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.

rbatoon:
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

BlueHazzard:
http://forums.codeblocks.org/index.php/topic,22241.0/all.html

Navigation

[0] Message Index

Go to full version