Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse does not recognize types from stdint.h for ARM Windows GCC toolchain

I have Eclipse Juno for C/C++ developers installed together with GNU ARM C/C++ Development Support plug-in from http://sourceforge.net/projects/gnuarmeclipse.

In my project I am using types like uint_32t, int16_t and uint8_t than normally comes from stdint.h. While I forced the Eclipse to see the standard headers of my compiler by directly pointing the directory where the include directory lies, mentioned types are not resolved. This gives me a lot of red markings about unresolved symbols and do some problems with code completion of the functions declared with these types.

The same problem is with standard macro definitions like GNUC - normally CDT see these for GNU C or GNU C++, but with toolchain set to ARM Windows GCC it don't. Strange.

What can I do to resolve that and return the main boost Eclipse gives in productivity?

like image 736
Michał Fita Avatar asked Jul 26 '12 09:07

Michał Fita


4 Answers

I think I found solution to my problem. The problem was the CDT GCC Builtin Compiler Settings provider, which tried to run the gcc instead of arm-elf-gcc. I added prefix to the field Command to get compiler specs:¹ to invoke compiler by its proper name.

And voilà, all unresolved symbols disappeared.

Unfortunately I broke my project by changing toolchains (never do this if you have GNU ARM Eclipse plugin installed!) but that is another story.


¹ - It is under: Project Properties > C/C++ General > Preprocessor Include Paths, Macros etc., the tab Providers; Share settings entries between projects (global provider) has to be disabled to edit that field.

like image 126
Michał Fita Avatar answered Nov 06 '22 20:11

Michał Fita


please note that GNU ARM Eclipse plugins were updated in Oct 2013, and the new version has better support for path discovery, so this problem is less likely to occur.

changing toolchains was also fixed.

like image 34
ilg Avatar answered Nov 06 '22 18:11

ilg


If you are using external Makefile, Eclipse has no way of knowing where your standard library for the target platform is located. The solution, that I have found, is to add the library include paths to

Project->Preferences->C++ General->Paths and symbols.

like image 1
Vorac Avatar answered Nov 06 '22 20:11

Vorac


I had the same issue and the solution from this page helped solving it:

  • Enter project properties -> C/C++->Preprocessor Include Paths,etc.->Providers
  • Click on CDT GCC Build Output Parser and change the compiler command pattern from (gcc)|([gc]++)|(clang) to (arm-none-eabi-gcc)|([gc]++)|(clang)
  • Click apply button
  • Click on CDT Built-in Compiler Settings Cross ARM and replace ${COMMAND} with arm-none-eabi-gcc.
  • Click apply button.
like image 1
Vahid Shirvani Avatar answered Nov 06 '22 18:11

Vahid Shirvani