- AVR GCC plugin - eclipse

eclipse could not execute Avr-GCC
I am new in eclipse.
I intend to use the eclipse Avr GCC plugin, but after offline installation of that I confront an error:
could not execute Avr-GCC, please check the avr paths in the preferences
what's your advice to solve the error?
eclipse could not execute Avr-GCC

Related

Pkg-config for Eclipse CDT macOS | None of my brew packages are showing

I am new to Eclipse and am setting up a Gtk development environment. I am trying to use this Eclipse plugin here: https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt
My issue is I have been unable to get Project > Properties > C/C++ Build > Pkg-config to populate with any of my packages installed through brew.
I was following this tutorial:
https://villavu.com/forum/showthread.php?t=85880
As the tutorial suggests, in Eclipse settings > C/C++ > Build > Environment, I have added PKG_CONFIG_PATH and the pkg-config folder path as the value.
I have tried in Project > Properties > C/C++ Build > Pkg-config > Advanced to adjust the default pkg-config search path to /opt/homebrew/lib/pkgconfig which is where my packages are.
I am not sure whether it is my system, the Eclipse plugin, or I am missing something easy. If someone has a proven IDE for Gtk on mac M1, then I am also open to trying it.
Thanks!
System: Mac M1 chip, Ventura 13.1.

Creating Eclipse CDT using CMake on Windows

I am trying to create a simple helloworld Eclipse CDT project using the CMake GUI. The CMake file looks like this:
cmake_minimum_required(VERSION "3.11.1")
project("HelloWorld")
add_executable("HelloWorldMain" "Main.cpp")
install(TARGETS "${PROJECT_NAME}" DESTINATION bin)
install(FILES "Main.cpp" DESTINATION src)
The only c/c++ compiler I have is MSVC so I set that as the CMAKE_CXX_COMPILER but I get an error when configuring as shown here:
I know this file exists, but how do I get it to find it?
I ended up not using the GUI. Instead I used the VS x64 Native Tools Command Prompt then ran the cmake command:
cmake -G "Eclipse CDT4 - NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 ../

How do you change the cmake generator in Eclipse?

For some reason it forces -G Ninja when I try to build within eclipse. I would prefer Eclipse just not specify the -G option to cmake, but I can't figure out how to configure Eclipse to do that.
For exampe, this in my console window:
Building in: /home/bgass/eclipse-workspace/scomlib/build/default
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON /home/bgass/eclipse-workspace/scomlib
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file or choose a different binary directory.
cmake --build . -- -v
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Build complete (0 errors, 0 warnings): /home/bgass/eclipse-workspace/scomlib/build/default
In a terminal it works just fine without the generator specified.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON /home/bgass/eclipse-workspace/scomlib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bgass/eclipse-workspace/scomlib/build/default
I always execute cmake outside eclipse and open the generated eclipse project in Eclipse.
use -G "Eclipse CDT4 - Unix Makefiles" to specify Eclipse as the generator.
Following are the full set of Eclipse generators.
Eclipse CDT4 - NMake Makefiles
= Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - MinGW Makefiles
= Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
Type in cmake --help to see what generators are supported by your specific cmake version.

How to choose a specific MinGW installation for eclipse CDT

I am using 32-bit eclipse CDT Kelper to manage a piece of code, which I could compile on command line but not with eclipse if I use any up-to-date c++11 feature. CDT tells me that "-std=c++11" is unrecognized.
After turning on the verbose option in project properties\settings\tool settings, I found that eclipse CDT somehow chooses an older version of MinGW that comes with Haskell platform 2013.2:
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC)
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\vaomp_bnb.o' '-shared-libgcc' '-mtune=i386' '-march=i386'
c:/haskell platform/2013.2.0.0/mingw/bin/../libexec/gcc/mingw32/4.5.2/cc1plus.exe -quiet -v -iprefix c:\haskell platform\2013.2.0.0\mingw\bin\../lib/gcc/mingw32/4.5.2/ -dD ..\src\vaomp_bnb.cpp -quiet -dumpbase vaomp_bnb.cpp -mtune=i386 -march=i386 -auxbase-strip src\vaomp_bnb.o -g3 -O0 -Wall -version -fmessage-length=0 -o C:\DOCUME~1\ting\LOCALS~1\Temp\ccWNoh7I.s
GNU C++ (GCC) version 4.5.2 (mingw32)
I searched SO, and there is a similar question a half year ago here. But the answer there was about setting environment variables and didn't solve the problem.
In my case, CDT can find a MinGW GCC, but found the wrong one. I have installed tdm-gcc 64 bit with gcc-4.8.1, and Haskell platform. The tdm-gcc has priority and
gcc --version
on both DOS and MSYS shows
gcc.exe (tdm64-2) 4.8.1
I don't know what heuristic does CDT use to find toolchains. My question is, how can I tell CDT to use the gcc in a specific location, e.g. c:/MinGW?
Note, I can't uninstall the Haskell platform version of gcc as I will need HP.
Thanks,
I figured it out. It seems that Eclipse CDT does not take tdm-gcc MinGW 64-bit because eclipse itself is 32-bit. So it picked up the only 32-bit MinGW it can find, which is the old version from HP.
To verify this, I installed java 1.7 64-bit, and downloaded 64-bit version of Eclipse CDT (Kelper). Now, CDT automatically selects the TDM-GCC 64 version of MinGW gcc.
For those in a similar situation, one additional issue is that the 64-bit CDT - MinGW64 combination combination does not build projects. No binary/executable files are generated even for a newly created HelloWorld c++ project (even though compilation is OK). In my case, I changed the build tool in the project properties..\tool chain. from CDT internal builder to either of the other two options (one is Gnu's and another is a long name), and then the project can be successfully made to generate exe files.

not able to run c/cpp execs in eclipse cdt

I installed eclipse and then cdt on an ubuntu system recently and was trying to make the first runnable c/c++ proj..
I installed g++ also, and then created the first executable cpp 'Hello World' project
some files are created... then some issues...
even though Build Automatically is selected, I have to goto the
project n do a Build Project to build it manually, and this i have
to do every time I make a change
After Building manually, there are some new folders created with Binaries and Debug files and I can see g++ commands in the console being executed. The project binary is output both to debug n binaries folder. But i am not able to run these through the Green Play Button or any other way in eclipse. Even Run configuration is not showing any option for C/C++ project..
Though I can goto terminal and run the binary myself through ./
But I want to be able to run n debug this through eclipse.
please help in fixing me this problem as I really love eclipse n have some c/cpp assignments coming soon..
Console info on doing a manual project build -
Build of configuration Debug for project qwe **
make all
Building file: ../src/qwe.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/qwe.d" -MT"src/qwe.d" -o "src/qwe.o" "../src/qwe.cpp"
Finished building: ../src/qwe.cpp
Building target: qwe
Invoking: GCC C++ Linker
g++ -o "qwe" ./src/qwe.o
Finished building target: qwe
Build Finished **
I had an identical problem and solved it by installing two additional "C/C++ Development Tools" that didn't show up when I originally filtered for "cdt" in Eclipse software update. Filter for C++ instead and you'll spot them, after install and reboot everything works.