having trouble with winavr gcc in eclipse c/c++ - c++

I am using eclipse c/c++ when i create a c project then it does not shows winavr gcc in the toolchain list but i have installed WinAVR-20100110 in c drive and my eclipse is also in the same directory.
it shows cygwin,solarize,linux,macosx,mingw gcc

Eclipse does not look for AVR toolchain by default, even if it is in path (you did add it there?). You need to create an cross GCC project, then tell it the prefix of your toolchain (avr- i guess). When you select "New C project" select Cross GCC in Toolchains listbox, then in next step enter the prefix, set path to toolchain (if not in path), etc. For this you need to install "GCC Cross Compiler Support". You do this from Help -> Install new software -> Mobile and Device development. You will probably also want at least GDB hardware debugging.
You can also try special eclipse plug-in for AVR.

Related

Eclipse Can't Find MinGW/Can't setup C++ on Eclipse

I am trying to setup c++ in Eclipse IDE. I have installed the C++ Development Tools and C++ Development Tools SDK. I have read "Before you begin" in "C/C++ Development Guide". I have installed MinGW on the page it provides. It installes it to C:\MinGW which Eclipse said it could recognize. I create a new makefile C++ project with MinGW selected as my tool chain. I had to uncheck "Show toolchains only if they are supported on the platform". It doesn't work. I have spent hours on trying to make this work.
You need to tell Eclipse where to gcc.exe and g++.exe.
In your case I would expect that to be C:\MinGw\mingw32\bin or C:\MinGw\bin.
If there's no gcc.exe and g++.exe there, it would appear your MinGW setup is broken.
Note that plain MinGW is a not very well maintained or up to date. I would recommend switching to MinGW-w64, which exists for both Windows 32-bit and 64-bit. A standalone build for Windows of recent MinGW-w64 can be downloaded from https://winlibs.com/. Just extract the file (no installer needed) and point to the mingw32\bin or mingw64\bin folder to find the compiler toolchain.

Difference between cross GCC and MacOSX GCC on eclipse

I've just downloaded the eclipse IDE for C/C++ developers I wanted to start a new project.
After choosing the location for the file, I was asked to choose between these two toolchains:
cross GCC
and
MacOSX GCC.
What's the difference?
Which one should I choose?
In CDT, Cross GCC is a cross-compiler project, one that can build binaries for other platforms/architectures. MacOSX GCC builds only for Mac.
This happens in other operating systems too. If you run CDT in Linux, you must select between Cross GCC and Linux GCC. In Windows, you may select between Cross GCC, Cygwin GCC and Microsoft Visual C++
As #Jaime said, "In CDT, Cross GCC is a cross-compiler project, one that can build binaries for other platforms/architectures. MacOSX GCC builds only for Mac."
But for guidance on which one to choose, according to this article, Cross GCC won't work in Eclipse, so MacOSX GCC is the way to go:
make sure that you select “MacOSX GCC”. I experienced that selecting
the other option (i.e., Cross GCC) does not allow eclipse to run your
project. In fact, by choosing this wrong option you’ll get the
annoying message of “Launch fail. Binaries are missing” when you try
to run your project.

Eclipse Juno CDT running in Linux - it does not give me any toolchain

I am using Slackware 14 and latest Eclipse Juno.
As a regular Eclipse user, I installed CDT just like I always did. However, when I create a new project, there is no toolchain available. Screenshot here:
I remember I used to get the default GCC toolchain available as soon as I have CDT installed in Linux. Even if using BSD, I could install GCC cross compile toolchain and it just works for native GCC as well. I tried to install the cross compile toolchain and CDT does not pick it up.
Please offer your suggestions, thank you.
you should install it from help menu
I had the same problem. At some point, I could program in C++ with Eclipse. One day, it can't find any tool chain even when there are a couple of them. Basically, you need to reinstall your CDT plugin with assumption that you installed your tool chain in a correct place - for this, you need to refer to instructions for your Linux distribution.
Here is what I did without changing anything on toolchain:
Uninstall CDT from Eclipse
Help -> Install new software -> Click the link "Already installed" -> Select CDT items -> Click Uninstall
Install CDT again
This got me my toolchain back in Eclipse.
In case reinstalling does not work, it means you have unsupported toolchain for some reason. Uncheck Show project types and toolchains only if they are supported on the platform on the new project dialog. Then it will show the toolchain. You can go ahead to select the toolchain to create the project. But I'd try to find why the installed gcc is unsupoprted.

Searching for a C/C++ IDE for OS X that can use a custom gcc installation

I'm on OS X 10.7.2 "Lion", and I'm developing a C program that has to use some OpenMP 3.0 specific functionalities. Therefore, gcc 4.2.1 is not enough for me, I need gcc 4.4 or better.
I downloaded MacPorts and easily installed gcc 4.4. Running it from the command line just works fine, and compiles my OpenMP 3.0 C program with no hassle.
But it's quite annoying for me to edit the source in Xcode or TextWrangler and compile it from the command line. So I tried Code::Blocks, which took me 1 hour trying to make it work under OS X, but it crashes anytime for no reason. Then I tried Eclipse, but it sticks on using gcc 4.2.1 even if gcc 4.4 is installed and can be run from the command line. Finally, I tried MonoDevelop, which uses gcc 4.2.1 as well and I just can't see how can I force it to use my favourite gcc version.
What I'm kindly asking you is: is there any decent C/C++ IDE for OS X that I can use which will let me to specifiy what gcc version to use (just like Code::Blocks under Windows) without horrible workarounds and/or breaking gcc 4.2.1 (I need it up and working for Xcode)?
Thanks in advance.
You should be able to use your gcc with Xcode, without breaking the existing gcc toolchain. Follow these instructions (which describe how to use a custom clang build, but the same principle applies to gcc).
Eclipse is OK, it can be configured to use any compiler (or several at once or whatever).
it sticks on using gcc 4.2.1 even if gcc 4.4 is installed and can be run from the command line.
If you want a global setting, then go to C/C++ / Build / Environment in your preferences and set its PATH to wherever your favourite GCC is.
If you want to be more specific, you can edit a specific project's preferences, for instance:
C/C++ Build / Environment -> Environment variables to set (there you can find and customize the final PATH that your compilation will use, per build configuration)
C/C++ Build / Settings -> GCC C++ Compiler (and others) - there you can customise the exact binary file of the compiler to execute (defaults to just g++), again per build configuration.
This even lets you have a project with 2 build configs, one for GCC 4.2 and one for GCC 4.4 for instance.

How to compile and run C++ with MinGW using Eclipse and CDT?

I would like to do some C++ development on Windows using Eclipse and the CDT plugin. I use Eclipse Helios SR1 and have installed the CDT plugin. I have also installed MinGW and now I wrote a simple "Hello World" in Eclipse.
hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
In Eclipse using the CDT plugin and the MinGW compiler. How can I compile my program? And how can I test run the program from within Eclipse?
Does Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X work for you?
After browsing many threads and articles I've found a solution.
Solution tested on Windows 10 x64 on Eclipse Neon.3 Release (4.6.3) with C/C++ Development Tools 9.2.1.201704050430 and MinGW
System configuration
Download MinGW. Any distro might work. I used the distro recommended on http://isocpp.org/
Extract archive into C:\MinGW (actually to C:\, because archive contains folder MinGW)
RMB on This PC -> Properties -> Additional system settings -> Tab Advanced-> Button Environment variables
On second table System variables click New. Name variable MINGW_HOME and set path to MinGW install folder C:\MinGW and then OK
Find variable Path in table and choose Edit
In new window click New and type %MINGW_HOME%\bin\
Confirm actions by clickig OK in opened windows
You can check availability of new tools by typing in command line g++ --version You should see something like
g++ (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Eclipse CDT configuration
Install Eclipse with CDT or just add CDT to existing Eclipse installation
Go to the folder with installed MinGW (C:\MinGW\bin\). Make a copy of file gcc.exe (DO NOT RENAME original file!)
Rename copied filed to mingw32-gcc.exe (You should have both files gcc.exe and mingw32-gcc.exe in \MinGW\bin\)
Open Eclipse and select C\C++ perspective
Go to Window -> Preferences -> C\C++ -> Build -> Environment
Click Add and type PATH as name and click on Variables and select Path. Confirm with Ok.
Select new variable PATH by clicking Select and then Ok.
Restart Eclipse
Now you should be able to compile Hello World program. Just select New -> C++ Project. Here you should see available MinGW as Toolchain
Just add MinGW to System Path(System configuration part in AndriiL's post) is enough. The variable named PATH with ${PATH} as value will be added automatically in Window -> Preferences -> C\C++ -> Build -> Environment and you can see MinGW GCC as a toolchain option in project wizard. If no PATH variable presented, Eclipse CDT may not load the recent System Path changes in the OS(Click Select... and choose Path variable, the value may not contain MinGW path), just Exit Eclipse and open it again.
Chocolatey is one package manager that allows mingw install with a single command using Windows Powershell.
choco install mingw --version=8.1.0
After the installation is done, add the below toolchain path to Eclipse->Window->Preferences-> Core Build ToolChains -> User Defined ToolChains.
C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\gcc.exe
Restart eclipse.
The MinGW toolchain should be available for use now in Eclipse.