Author Topic: Removing Hello World default text  (Read 10080 times)

Offline wolfcry

  • Multiple posting newcomer
  • *
  • Posts: 30
Removing Hello World default text
« on: March 28, 2010, 01:49:16 am »
Hello,

I asked this in an earlier thread but the question hasn't been answered yet and I can't find the solution anywhere. Not in the wiki nor on this site so I was hoping someone would be able to direct me.

Everytime I open a new file / project, the hello world is statement is already there in the template. I want to remove that but don't know where to do this.

Thank you.
C::B Version = 10.5
OS = Microsquish XP

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Removing Hello World default text
« Reply #1 on: March 28, 2010, 11:10:27 am »
Sorry, but your questions sounds like you do not know how to remove text from a file.
I can not believe, that it is what you mean, so my question: do you want the template being created with empty main.cpp ?

If yes, you can just create a new project with the wizard, fix everything as you like it for your default project and saev it as user-template ("File -> Save project as template").

To use the template chose: "File -> New -> From template..."

Offline wolfcry

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Removing Hello World default text
« Reply #2 on: March 28, 2010, 08:03:25 pm »
Hi jens,

Sorry, I didn't realize that's how the question was making it seem. I definitely could have reworded the way I asked lol. That's funny. I better know how to remove text from a file lol.

Yes, removing the default 'hello world' text from the template itself is what I meant. Ok, now while what you suggest will work and I have taken your advice and created my user template, however, I was hoping to be able to edit the template C::B uses during project creation.

The reason being, when creating a new project using the user template, I have to search for and locate the directory / folder that I'm using in order to create the new project files themselves and I don't want to have to keep doing this.  I work on different projects at a time and frequently have to create new projects so this isn't optimal for me.

Thank you for your help.
« Last Edit: March 28, 2010, 08:06:48 pm by wolfcry »
C::B Version = 10.5
OS = Microsquish XP

Offline wolfcry

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Removing Hello World default text
« Reply #3 on: March 29, 2010, 02:23:28 am »
I'm still having difficulty getting rid of the inserted "hello world" text from appearing in the main.cpp source file that C::B creates when you create a new project.

I do not want to have to use a user template because I'm forced to search and locate the directories I store C++ projects, then create a new folder (which I then have to rename manually), then create a name for the project every time I want to use a user based template.

These are all unnecessary steps that are extremely annoying and time consuming as the day moves on and as new projects need to be built.

This is what I want to happen:

1. start new project
2. click on console application
3. select C++
4. go through steps of console application wizard.
5. When the project is successfully built via the wizard, click on the sources folder, open up the main.cpp file and NOT have this included into the file:

Code: [Select]
cout << "Hello world!" << endl;
I've read through the manual, searched this site, the wiki site, explored the tools and options in the C::B application itself, tried right-clicking on the console application icon to edit the template, as well as the files listed under "Files" in the wizard, and I still cannot find that text. I even tried finding the template that is used by searching the programs installation folders and nothing.

How do I remove that text?

C::B Version = 10.5
OS = Microsquish XP

Offline codie

  • Single posting newcomer
  • *
  • Posts: 8
Re: Removing Hello World default text
« Reply #4 on: March 29, 2010, 09:49:23 pm »
Whether its the right way or not, I rid any new C++ console main.cpp files of the Hello World stuff by editing the file in this directory:

C:\program files\codeblocks\share\codeblocks\templates\wizard\console\cpp\main.cpp

the wizard grabs this file so now I have a starter main.cpp with any comments, includes or whatever I want to start with.

right or wrong that worked for me ... it appears all the wizard starter files are in that path

Offline wolfcry

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Removing Hello World default text
« Reply #5 on: March 30, 2010, 05:01:58 am »
Thank you so much Codie! 

Worked like a charm!
C::B Version = 10.5
OS = Microsquish XP

Offline herosz

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Removing Hello World default text
« Reply #6 on: January 09, 2015, 12:49:05 pm »
editing the file in this directory:

C:\program files\codeblocks\share\codeblocks\templates\wizard\console\cpp\main.cpp

the wizard grabs this file . . .

Nice stuff  ;D
I wanted a long time  a solution to escape to "Hello word! " an insert some commonly used #include files.
Thank's, this is an ideal solution !
(I don't like template because  every time I need to locate the  folder that I'm using in order to create the new project files .