33

I'm trying to create a C++ project on eclipse. I have installed eclipse-cdt for that.

While creating a project, a pop up window asks for cross compiler prefix and cross compiler path. Could someone please explain what are those and what do I need to add in those fields? Are those fields absolutely necessary to fill?

demongolem
  • 9,474
  • 36
  • 90
  • 105
nish
  • 6,952
  • 18
  • 74
  • 128

5 Answers5

13

If you are using a Mac, you can select MacOS GCC instead of Cross GCC. If you are on Windows, you will have to install a C++ compiler. I recommend you install Cygwin, try following the directions here. https://www3.ntu.edu.sg/home/ehchua/programming/howto/eclipsecpp_howto.html Once you've installed the C++ compiler, restart Eclipse and try to create the project again. Hope this helps.

yeremy
  • 161
  • 1
  • 9
0

In Cross compiler Prefix you need to write 'arm-none-eabi-' and in Cross compiler path you have to select the path for GCC bin folder. You need to install Cygwin GCC for this. I have found few steps in below link.

https://www3.ntu.edu.sg/home/ehchua/programming/howto/Cygwin_HowTo.html#cygwin

rmkyjv
  • 35
  • 9
0

Just in case anybody else is like me and needs more explicit directions as @yeremy is correct in that you have to select MacOSX GCC. It's just that at the point where the OP is, he overshot where he could have made the selection and needs to back up a few windows (about 3) to choose the MacOSX GCC as the Toolchain of choice. Attaching a link below which goes through the steps and which also shows image of window where you can make the selection (figure 11).

Getting Started with C++ for Eclipse - CodeGuru

thuynt13
  • 41
  • 1
  • 4
0

When Eclipse doesn't detect a toolchain (to be installed separately) it only offers the option "Cross GCC". Don't choose that.

Sites like this tell you that a properly installed toolchain (Cygwin / MinGW) is automatically discovered using the PATH environment variable. This is not the case on my machine.

There's no way to configure a toolchain in Eclipse manually (as of writing) but you can fool Eclipse into finding one without changing your global PATH:

Go to Window/Preferences/C/C++/Build/Environment,

Add a variable PATH and point it to your toolchain path(s), e.g. d:\Mingw\bin;d:\Mingw\msys\1.0\bin. Separate paths with a semicolon.

Invictus
  • 3
  • 2
Mark Jeronimus
  • 9,278
  • 3
  • 37
  • 50
-1

For newbies just starting out C++ projects in Eclipse:

1 - Click File --> New--> C/C++ Project

2 - In the "Templates for New C/C++ Project" window, Select C++ Managed Build --> Click Next

3 - Provide a project name --> Select "Empty Project" in Project Type section (which is under Executable) and Select "MinGW GCC" in the Toolchains section

4 - Click Finish

Note: Selecting "MinGW GCC" will eliminate the headache of inputting the Cross GCC related prefix and path. Happy C++ learning.

enter image description here