Author Topic: How to open existing projects  (Read 20388 times)

Offline PigeonPoop

  • Single posting newcomer
  • *
  • Posts: 2
How to open existing projects
« on: August 27, 2016, 08:06:18 pm »
Hello,
So say you have made your first project, the   "Hello World" program, then you cleared your workspace and then you want to open the program again as a project.
When you open with  'Open file...' or 'Recent projects' it just opens the file again but not as a project (you are not able to run debuger etc.) .
I could just create a new project and copy paste the code in and then delete the old project but thats very annoying. Any way around that?
Thx  :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How to open existing projects
« Reply #1 on: August 27, 2016, 10:28:52 pm »
'Recent projects' works for me.

Or File -> Open
And, then select the project works.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PigeonPoop

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to open existing projects
« Reply #2 on: August 31, 2016, 06:07:18 pm »
Ok, but that only opens the file you selected not the whole project.
You can't debug it or see all the files in the workspace...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How to open existing projects
« Reply #3 on: August 31, 2016, 06:34:16 pm »
Ok, but that only opens the file you selected not the whole project.
You can't debug it or see all the files in the workspace...

YOU OPEN THE PROJECT FILE!!! And, it opens the whole project!

Edit: If you wish to open a whole workspace you open the workspace file!

NOTE: You might have to do a save as Workspace file in order to open it.

Tim S.
« Last Edit: August 31, 2016, 06:35:51 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline playinmyblues

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to open existing projects
« Reply #4 on: July 11, 2017, 09:32:00 pm »
Very much a noob here, but especially to Code::Blocks. I just had the same problem. I opened the main.cpp file and tried to compile it and it would not. I Googled the problem and found this link with advice to open the project. I did that and tried to compile it - no satisfaction.

What did work was opening the project and make sure the selection under Workspace is on the project and not the main.cpp file. Ctrl-F9 (build) and then F9 (build and run) worked. You want to build it first to allow the IDE to check for errors.

I have found in the programming that I have studied that writing your programs in a text editor with syntax highlighting and compiling and running the program from the command line is the best option for beginners. It allows you to focus on the program you are writing instead of the all the steps required to make a full-featured IDE work.

For instance, if using Python 3, write your program in the text editor (NotePad++ or Kate are good examples), save it, switch to the command line and type:
$ python3 programName.py

What you end up with is either a program that runs, or you get something with error messages telling you where your error is located (or somewhere near where your actual error is). It is this type of experience that allows a programmer to figure out what is a programming error and what is likely something to do with the IDE. Even the Python IDLE is better than a full-featured IDE such as Code::Blocks. Eventually, you get to understand when your program should run and when there is an error in it that produces some error message.

Yesterday, I had my program running from Code::Blocks and today it would not work. I knew it should run, as the OP had done but I knew something was not happening in the IDE. One clue that there was something not done correctly is that all the options under the Build pull-down menu were grayed out. And it is frustrating to figure out when you have very little experience with programming.

Eventually, as you build experience with programming, learn how to apply your problem solving skills to solving your programming problems in all areas of programming, such as working with your IDE, getting your program out to the public, etc. The getting your program out to the public, etc. part is not an option for me yet but the situation should still apply.