Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Why do I have to jump through hoops to set up the CDT?
Why do I have to jump through hoops to set up the CDT? [message #1778486] Thu, 14 December 2017 18:41 Go to next message
Jake Hyde is currently offline Jake HydeFriend
Messages: 1
Registered: December 2017
Junior Member
// Preamble - Just Background Info
I am about at my wits end here. I used VS2017 as my C++ IDE, but I found the idea of having one program like Eclipse for my development enticing. First came installing a toolchain: Cygwin seemed like a good choice. Still an error every line.
// Problem
I have managed to include a few folders so <iostream> now does not have an error, as well as std. cout and endl STILL cannot be resolved and building the project of course says that the binary cannot be found (no exe is built either). Below is the Hello World application I am trying to run:
// Info
#include <iostream>
using namespace std;

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

// Errors
Program "g++" not found in PATH
Program "gcc" not found in PATH
Symbol 'cout' could not be resolved
Symbol 'endl' could not be resolved
// Extra info
I have spent the past few weeks combing these forums,the stack exchange, and google for anyone that solved a similar problem. While I did narrow my problem down, I feel as though setting up CDT for Eclipse does nor should not be this difficult and would like some insight into how exactly I can solve this problem.
Re: Why do I have to jump through hoops to set up the CDT? [message #1778548 is a reply to message #1778486] Sat, 16 December 2017 16:29 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 379
Registered: August 2014
Senior Member
It seems that a) your installation does have the C and C++ compilers installed into Cygwin and/or b) Eclipse does not have a serach path to the Cygwin tools.

Please open your Eclipse and from the menu Help -> Help Contents -> C/C++ Development User Guide, items Before you begin and Getting Started; and follow the instructions there.


--

Tauno Voipio
Re: Why do I have to jump through hoops to set up the CDT? [message #1778915 is a reply to message #1778548] Sat, 23 December 2017 18:58 Go to previous messageGo to next message
Vaclav Sal is currently offline Vaclav SalFriend
Messages: 168
Registered: September 2014
Senior Member
Welcome to Eclipse (forum?) , where one posts, hundreds read and no one rally answers you question.
Eclipse is "Swiss army knife" - to program in C/C++ do "Help->Install New Software...
Than select all sites and filter with "CDT" ,
You do not have to filter , but than things slow down on initial load - tons of stuff you probably do not need.
Question remains - how did you manage to write default "hello word" in C (?) without GCC ?
Also pay attention to "Configuration" - another set of blades on your knife.


Re: Why do I have to jump through hoops to set up the CDT? [message #1779590 is a reply to message #1778915] Wed, 10 January 2018 02:43 Go to previous messageGo to next message
Andrey Sotnikov is currently offline Andrey SotnikovFriend
Messages: 21
Registered: October 2014
Junior Member
Vaclav Sal wrote on Sat, 23 December 2017 18:58
Question remains - how did you manage to write default "hello word" in C (?) without GCC ?
You cannot do it without GCC. Eclipse per se doesn't have a compiler. It's up to you to supply one. If you want to develop in Windows using CDT, install MSYS2 and MinGW GCC toolchain in it.
Re: Why do I have to jump through hoops to set up the CDT? [message #1779714 is a reply to message #1778486] Thu, 11 January 2018 15:04 Go to previous messageGo to next message
just humm is currently offline just hummFriend
Messages: 3
Registered: January 2018
Junior Member
@JJake Hyde

I'm completely new to both C++ and IDE's in general.

I recently installed Eclipse Oxygen and (seem to be) using Win-Builds 1.5 for the minGW compiler.

I still haven't figured out how to incorporate "using namespace std" without getting an error.

To get rid of the "Program "g++" not found in PATH" error, I have to manually add an Environment Variable (MINGW_HOME) with the compiler path. I'm not sure how to get eclipse to do this automatically.

And I've noticed that "Please open your Eclipse and from the menu Help -> Help Contents -> C/C++ Development User Guide, items Before you begin and Getting Started; and follow the instructions there." seems to be a popular response, but I've found the Help information to be lacking...from a beginner's standpoint, anyway...

https://preview.ibb.co/nuAHu6/Capture.jpg



Re: Why do I have to jump through hoops to set up the CDT? [message #1779723 is a reply to message #1779714] Thu, 11 January 2018 19:01 Go to previous messageGo to next message
Andrey Sotnikov is currently offline Andrey SotnikovFriend
Messages: 21
Registered: October 2014
Junior Member
For me it was enough to specify the path to the gcc executable in my PATH environment variable. Eclipse was able to figure out it's MinGW and retrieved automatically the paths to the MinGW system include header files. I used MinGW from here: http://www.msys2.org/. After installation of MSYS2 and all its updates, I issued 'pacman -S mingw-w64-x86_64-toolchain' from the MSYS command line and then added C:\msys64\mingw64\bin to the PATH environment variable.

[Updated on: Thu, 11 January 2018 19:02]

Report message to a moderator

Re: Why do I have to jump through hoops to set up the CDT? [message #1780230 is a reply to message #1779723] Thu, 18 January 2018 22:16 Go to previous messageGo to next message
Michael Murdock is currently offline Michael MurdockFriend
Messages: 25
Registered: May 2014
Location: Pittsburgh, PA
Junior Member
I have asked this very question on this forum. Basically same question. It was my understanding, if I load the CDT to install or starting with that package, I'd get all the compiler versions it supported. Is this not true. I'm using a Win7SP1 64-bit system. I also have VS2017 Community edition installed. I have verified using the MS VS Toolset in Eclipse does compile. Not GCC/C++
(g++ or gcc). No could I get Managed CDT build, etc.

I don't have cygwin in use. I did go to the GCC MCU website to get their version of Eclipse Oxygen SR2 w/ CDT though it is only up to CDT 9.3 and I am using 9.4.

How do I go about getting each toolchain toolset such as GNU tools or MinGW, and so forth...?

I would stay with VS 2017 except I can't find a Mercurial extension there my code repository is there. I did get the other pieces of code to compile in VS2017 such
as Qt library 4.7.3 and some code I got from the NGA website. My connundrum is trying to get it compile with Eclipse and Win7.

Why is this so difficult?

I don't remember it being difficult in OS X and Eclipse (though most work I have done there was Neon). So I don't know if Oxygen is much different.

Where does these tools go?? I vaguely remember where VS2015 put it when It to do some MFC code on Win7 (I just hate that environment).


A solution can not be found to a problem
with the same mind that created it.
- Albert Einstein
Re: Why do I have to jump through hoops to set up the CDT? [message #1780241 is a reply to message #1780230] Fri, 19 January 2018 03:36 Go to previous message
David VavraFriend
Messages: 730
Registered: October 2012
Senior Member
This seems an endless source of confusion to beginners.
It stems from not understanding what Eclipse actually is.
It is a text editor that
1) can do some syntax checking
2) can build a project using external tools.
It does not contain a compiler or linker.

When building a project, Eclipse expects to use the make utility.
It does have a built-in make emulator.
The tool chains are little more than experts in setting up parameters in make recipes.
If the project already has a makefile then the tool chain is superfluous.
Eclipse also assumes you know how to use make and the tool chain outside of Eclipse.

Eclipse under Windows will detect installations of VS, MinGW and cygwin and offer the use of specialized tool chains for them.
The tools must be independently installed.
Where? The short answer is wherever the tool provider wants them installed.
GCC comes with most Linux distros so rarely would it need special installation with Linux.
For MinGW: http://www.mingw.org/category/wiki/download
and http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite

In general:
http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_o_home.htm
http://help.eclipse.org/oxygen/index.jsp
https://www.eclipse.org/users/

The Indexer provides cached definitions for syntax analysis.
It mostly relies on the compiler to find the locations of the builtin include headers.
Primarily with: Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
Note the GCC Built-in provider with various tools (like MinGW and cygwin); https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_sd_providers.htm
More documentation here: https://help.eclipse.org/oxygen/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_scanner_discovery.htm?cp=13_4_7_0_4_6

Previous Topic:Toggle Comment (Ctrl+/) hotkey problem in Oxygen.2
Next Topic:Install New Software not giving option for Kesler download
Goto Forum:
  


Current Time: Mon Jun 18 10:08:21 GMT 2018

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

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

Back to the top