Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: rickg22 on June 08, 2005, 12:37:32 am
-
Do you think codeblocks should allow to compile a single file (without a project)?
Yes / No / Why? Remember, it's you users who decide! :)
-
Well, this stuff may be usefull for quick'n'dirty written programs to solve small problems
However it's not necessary as c::b allow project with one file in it :)
Moreover rare program has only one source file
-
I don't really need it, as I rarely need to compile a single file, and if I ever do I can always use my always-open command prompt.
So I wouldn't mind if you add it, but no rush ;).
-
It is not needed for me, mingw only compiles modified c/cpp files. It is nice to have it when you only change 1 .h file :)
but no rush ;).
:lol:
-
Hi!
Although this is covered by editors like SCiTE, I guess it's a nice feature, especially for newbies in programming who mostly deal with single files when they start programming in C.
-
I think that it would be nice to compile single files. However, i'd like to choose a project (or template) to compile them. If i choose a project, the file is compiled as part of the project, without altering the project per se.
I'd have to look more into this to see how it could be done. But at least the idea looks fine to me.
Example:
You're about to compile a single file. Please choose:
* Compile into console executable
* Just compile as it is
* add to project and compile.
-
I would see more gain in being able to compile multiple executables in one project. For example you got a program with GUI and you want the exact same program also available as console/parameter based, but want both to be single file executables without shared libraries. Instead of having 2 'projects' in the same folder with the same files listed in each, I'ld rather be able to make a new target that links to another file in the project and a different executable name.
Ofcourse this could also be easily used then to have an educational project holding multiple single-file executables.
-
I would see more gain in being able to compile multiple executables in one project. For example you got a program with GUI and you want the exact same program also available as console/parameter based, but want both to be single file executables without shared libraries. Instead of having 2 'projects' in the same folder with the same files listed in each, I'ld rather be able to make a new target that links to another file in the project and a different executable name.
Ofcourse this could also be easily used then to have an educational project holding multiple single-file executables.
Someone correct me otherwise, but I think you can already do that by setting multiple targets.
-
SartriX: Just put the shared part in a static library and link it to both executables. That way you only have to compile that part once and it'll be included in both executables.
So indeed, use three targets:
- A static library (must be first in compile order)
- The console executable, link static library into this.
- The GUI executable, link static library into this as well.
[/list:u]
-
Someone correct me otherwise, but I think you can already do that by setting multiple targets.
No need to correct you. You 're absolutely right :)
Yiannis.
-
Someone correct me otherwise, but I think you can already do that by setting multiple targets.
No need to correct you. You 're absolutely right :)
Yiannis.
I hate missing buttons. Darn those graphical IDE's. *goes back to vim* :P
Anyway.. since you can even make targets for one file, one for each single file in a project even, then what's the point of the original question? Except for saving some minor clicking, I don't see it as an improvement, just another button too many.
-
Maybe some of you know PellesC http://smorgasbordet.com/pellesc/index.htm
a beautiful small but powerful Win32 C-compiler with IDE & Debugger.
Pelle (author of PellesC) has solved this point elegant.
if one wants to compile a source file without prior defining a project, then the IDE prompts,
if one wants to create a default project with the actual source file.
This default settings are good for a typical Hello-world console program,
which is practically good enough for all of that first-time hobby-programmers,
which are learning how to use a compiler, linker, debugger, IDE's and so on, and
still not know the difference of the mentioned tools nor are able to resolve linker errors
nor are able to set up a meaningful project setup with different source and header files.
This keeps the Pelles-C forum http://smorgasbordet.com/phpBB2/index.php
*nearly* free of the typical "cannot compile" spam.