Author Topic: Compile single file. Approve / disapprove?  (Read 11633 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compile single file. Approve / disapprove?
« 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! :)

Offline Profic

  • Multiple posting newcomer
  • *
  • Posts: 56
Compile single file. Approve / disapprove?
« Reply #1 on: June 08, 2005, 09:11:32 am »
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
Not fear, nor tears can reach me now, the light seems so clear as the night fades away (c) Tristania - Beyond The Veil

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Compile single file. Approve / disapprove?
« Reply #2 on: June 08, 2005, 02:14:58 pm »
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 ;).

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compile single file. Approve / disapprove?
« Reply #3 on: June 08, 2005, 04:50:28 pm »
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 :)

Quote from: fvbommel
but no rush ;).
:lol:
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline upCASE

  • Multiple posting newcomer
  • *
  • Posts: 16
    • http://www.upcase.de
Compile single file. Approve / disapprove?
« Reply #4 on: June 08, 2005, 05:14:30 pm »
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.
OS: Win XP Pro, Linux, Mac, CE
wx: 2.6.0
Compiler: VC 7.1, gcc 3.4.2, eVC 4  - If it was hard to write it should be hard to read... - Try not! Do. Or do not. There is no try.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compile single file. Approve / disapprove?
« Reply #5 on: June 08, 2005, 06:29:56 pm »
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.

Offline SartriX

  • Single posting newcomer
  • *
  • Posts: 8
    • http://www.vulcanusgames.net
Compile single file. Approve / disapprove?
« Reply #6 on: June 09, 2005, 11:25:29 am »
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.
Anything that makes life easier is worth making

Offline AkiraDev

  • Multiple posting newcomer
  • *
  • Posts: 71
Compile single file. Approve / disapprove?
« Reply #7 on: June 09, 2005, 12:48:58 pm »
Quote from: SartriX
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.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Compile single file. Approve / disapprove?
« Reply #8 on: June 09, 2005, 01:21:20 pm »
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]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Compile single file. Approve / disapprove?
« Reply #9 on: June 09, 2005, 01:48:29 pm »
Quote
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.
Be patient!
This bug will be fixed soon...

Offline SartriX

  • Single posting newcomer
  • *
  • Posts: 8
    • http://www.vulcanusgames.net
Compile single file. Approve / disapprove?
« Reply #10 on: June 10, 2005, 01:47:46 am »
Quote from: mandrav
Quote
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.
Anything that makes life easier is worth making

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Compile single file. Approve / disapprove?
« Reply #11 on: June 10, 2005, 02:29:53 am »
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.