User forums > Using Code::Blocks

How to run / debug a single file (without a project)

(1/2) > >>

danizobin:
BS"D

When I just open a file, without a project context, almost all the options under "build", "debug" are graid out.

Any ideas?

Thanks,
Dani

DrewBoo:
Aside from holding a bunch of files together, a project contains important information about what it means to "build" that project.  Things like what the built program should be named, where it should go, where header files can be found, whether it needs debugging info and what optimization level it should undergo.

So the answer I think you're looking for is that one would typically create a project, even if it's just for one file.  That's the norm for all IDEs I've used, anyway.

If an IDE you've used has a feature to "build and run whatever file is open", please let this forum know about it.  It could become a feature.

thomas:
Building using the default options that you can set in your compiler preferences can be done with "Compile current file", and once it is built, the program can be run using "Run" too.

Debugging (and several other things) does not work without a project. No, this won't be added.

danizobin:
Thanks,

Anjuta can compile, run & (i think) debug single files.
Very convenient for scholar environments when programs are sporadic and short.

Dani

Seronis:
Personally, i always have a project named 'quicktests' that use for throw-away 1 file programs.  Just select-all, delete, type new program (or copy/paste).

Navigation

[0] Message Index

[#] Next page

Go to full version