Author Topic: About Empty file[help]  (Read 6887 times)

Offline SupportGame

  • Single posting newcomer
  • *
  • Posts: 2
About Empty file[help]
« on: October 14, 2011, 04:47:49 am »
Hi everybody.
My name is Daniel, I'm a new user in this forum, and i need help about one doubt.

If i want to create a little problem, like pow.
Do I need to create a project?...
what about an empty file?
what is the difference between them?

i tried to make my code in an empty project, but codeblocks can't compile neither run.
please help.


thanks!






Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5234
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: About Empty file[help]
« Reply #1 on: October 14, 2011, 05:28:16 am »
As a beginner, you should firstly read some manual/wiki. Like: Creating a new project - CodeBlocks
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: About Empty file[help]
« Reply #2 on: October 14, 2011, 11:18:38 pm »
If you continue to have problems after reading the page ollydbg mentioned, it is possible you missed setting up a compiler.

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: About Empty file[help]
« Reply #3 on: October 15, 2011, 01:43:57 pm »
You must create a project, like in any IDE. This way, you will create a control file which will maintain your project files and which will compile, link, run and debug them. Select a project according to what you are about to write (wxWidgets, QT4, console app, GTK app and so on). You can also select an Empty project but then you get (almost) no additional support from the IDE - the IDE will only compile and link.

Note that CodeBlock is a "multi purpose" IDE, not (as it is usual) a "single purpose" IDE for a particular compiler and a particular development environment. Such "single purpose" IDEs are usually parts of compiler installation and they are already pre-configured for their particular usage. You can start them and start writing your apps in them outright. In CodeBlocks, you need to install your compiler and development environment (like QT4) first and then tell CodeBlocks, which compiler you are using. That's why you can find so many different "projects" on the list and that's why many of them will not work for you :)  You haven't installed the needed tools.

Okay, we have everything ready and we have selected our project. Go through the wizard, select the project directory, do not uncheck the debug build. At the end of the wizard, you can select an empty project, thet means, a project with no pre-added files to your project, no predefined "prototypes", no automatic-written comments, licence agreements and so on. If I understand well, that's exactly what you want to achieve. You will start with adding a new (empty) file to your project.

But before you start writing, configure your editor. It is well configurable and you will able to achieve most of your wishes. Also, configure keyboard shortcuts (again, a wide offer of configurable shortcuts). I don't think you will be disappointed with CodeBlocks :) IMO, it's the best open source IDE :)

Offline SupportGame

  • Single posting newcomer
  • *
  • Posts: 2
Re: About Empty file[help]
« Reply #4 on: October 16, 2011, 10:50:33 pm »
Thanls all for the help. I read all, including the links and now i'm well-informed about projects and files.
"I've clarified my doubts"