Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » "Hello World" example for Eclipse HELIOS(C++ with eclipse)
icon9.gif  "Hello World" example for Eclipse HELIOS [message #671953] Thu, 19 May 2011 12:53 Go to next message
Ahmet Ekrem SABAN is currently offline Ahmet Ekrem SABANFriend
Messages: 22
Registered: April 2011
Location: Austria
Junior Member
Hello!

Is there a simple "Hello World!" example for C++ (Eclipse HELIOS) that runs as easily as Java runs? I am satisfied with Eclipse when working with Java, but it seems to be unnecessarily complicated when creating a simple C++ project. For instance, you just compile a code written in Java, but you have to do additional steps, if you want to compile a C++ project.

Obviously, Eclipse does not have a kind of wizard that eases all preparations for a project, like installing make, CygWin, MingW, creating the make file etc. Or is there a way to create a project just by writing a make.cpp and the class files? Actually, one who wants to start with a C++ project may not know about such details and will be frustrated.

The link www. codingrecipes .com /eclipse-launch-failed-binary-not-found-and-netbeans indicates comfortable IDEs exist for C++, but Eclipse seems not to be one of them.

Thank you for your answers.

Kind regards!


Best regards!
Ekrem

[Updated on: Thu, 19 May 2011 14:26]

Report message to a moderator

Re: "Hello World" example for Eclipse HELIOS [message #672026 is a reply to message #671953] Thu, 19 May 2011 15:39 Go to previous messageGo to next message
Andrey Kourskov is currently offline Andrey KourskovFriend
Messages: 54
Registered: July 2009
Member
File -> New -> C++ Project
ProjectName = "HelloWorld"
Project type = Executable -> Hello World C++ Project

And just click "Finish"
Re: "Hello World" example for Eclipse HELIOS [message #672174 is a reply to message #672026] Fri, 20 May 2011 08:22 Go to previous messageGo to next message
Ahmet Ekrem SABAN is currently offline Ahmet Ekrem SABANFriend
Messages: 22
Registered: April 2011
Location: Austria
Junior Member
Thank you very much for your reply!

Yes, it is possible to create a "HelloWorld" project with a few clicks. But it doesn't run. That's what I need with simple: a newbie will get frustrated. If I click on the hammer symbol in the toolbar, the Console window shows the following:

**** Build of configuration Default for project HelloWorld ****


(Cannot run program "make": Launching failed)

A wizard-created project, like HelloWorld, should compile and run without problems. Smile

As somebody told me on another forum, Microsoft Visual Studio or NetBeans are much better for a newbie than Eclipse CDT.


Best regards!
Ekrem
Re: "Hello World" example for Eclipse HELIOS [message #672183 is a reply to message #672174] Fri, 20 May 2011 08:50 Go to previous messageGo to next message
Andrey Kourskov is currently offline Andrey KourskovFriend
Messages: 54
Registered: July 2009
Member
As you cannot compile any java project without JDK you cannot a compile c++ project without a toolchain.

There are a lot of instruction how to install a toolchain. (just for example http://www.youtube.com/watch?v=Bq6ypzUy__Q)

P.S. NetBeans doesn't have toolchain too.
Re: "Hello World" example for Eclipse HELIOS [message #672186 is a reply to message #672183] Fri, 20 May 2011 09:04 Go to previous messageGo to next message
Ahmet Ekrem SABAN is currently offline Ahmet Ekrem SABANFriend
Messages: 22
Registered: April 2011
Location: Austria
Junior Member
You are right! I am analysing NetBeans, but got from the tool the instruction where to go on the Web. That is a slight, but important difference. Of course, a wizard that asks only necessary questions and does the whole work would be the best.

An application developer should only know that a C++ project needs a main.cpp and classes that should be separated to cpp and hpp files. When they add a new class, the tool should create a pair of files with a
#include "<class name>"
line in the cpp file and a
#pragma once
line in the hpp file.

If it is known that for some reasons, it is useful to have all the class in one cpp file, there should be a preference on the Preferences page so that creating classes do not automatically generate a header file. (I do not think that this option is necessary, but creating a class with the IDE should create the file pair.)


Best regards!
Ekrem

[Updated on: Fri, 20 May 2011 09:29]

Report message to a moderator

Re: "Hello World" example for Eclipse HELIOS [message #672220 is a reply to message #672186] Fri, 20 May 2011 11:17 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
You are right! I am analysing NetBeans, but got from the tool the instruction where to go on the Web.

When you first Eclipse (or your ue Help->Welcome) you can select Overview and then C/C++ Development. This will bring up your browser and will show the Eclipse help. The first paragraph is "Before you begin". There you will find instrucions to get your toolchain (including links to click and follow). I would say that is straight forward.

Quote:
When they add a new class, the tool should create a pair of files with a

New->Other->C/C++->Class
This will create your cpp and header file etc.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:OSX debugging: launch failed binary not found
Next Topic:CDT hangs or is slow when start (gdb) debug session
Goto Forum:
  


Current Time: Thu Sep 19 17:42:52 GMT 2024

Powered by FUDForum. Page generated in 0.03973 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top