User forums > Using Code::Blocks

Making project is so inconvenient, isn't it?

(1/6) > >>

thanhbuu:
Does anybody have solution to make a *.cpp file without making project (but there are still full Released and Debug mode) ? I can't find anyway to do this? :(

MortenMacFly:

--- Quote from: thanhbuu on April 16, 2012, 06:53:07 pm ---Does anybody have solution to make a *.cpp file without making project (but there are still full Released and Debug mode) ? I can't find anyway to do this? :(

--- End quote ---
Different compiler sets (i.e. for release and debug) REQUIRE a project.

A work-around would be to use the Tools(+) menu and macros to get compiler / debug commands for single files, but I strongly recommend you use a project.

Next time, also please don't start a meaningless poll?! ???

Radek:
Why should it be so inconvenient? It's a few clicks and three files in your project directory. It's much more convenient than trying to set debugger and linker options without a project. Note also, that some IDE's (like Open Watcom) will always require a project and will not allow you to pass with "just this file".

Simply put: having an IDE = creating projects. If you do not want a project, run the compiler from a command line.

Freem:
There is the "compile file" function which can be used in cases of single junk file.
I already used it some day, if my memory is not bad, and it were able to generate the a.out file, and I were able to run it.

Obviously, I did not tried to debug it, because it was something with... maybe 20 lines?
A solution might be to create a dumb project, create file for functions you want to try, and fill the main with a simple switch.

For files with more than 50 lines, I think you should consider using projects, because that file could grow later when you will think about new features to add.

codeur:
For the unofficial education distribution only (Codeblocks-EP comes with bundled compiler and debugger, and supports C and C++ -using GCC- only) I am considering patching the source so as to enable automatic and transparent creation of a console project when there is  no open project and the user clicks on "Build" or "Build and run" while editing a file. Rank beginners tend to do this.

The project created would be a C++ or a C project based on the current file extension and the current file would be automatically added to it. Both release and debug targets would be created, all targets would be built. No project would be created when the extension is invalid.
Any issues with that?

I understand that this would not be of interest to the general distribution, but would be useful for students in their first programming unit in the version used in the education world .

Navigation

[0] Message Index

[#] Next page

Go to full version