Eclipse Embedded C marks some imported symbols as undefined - eclipse

I have set up an Eclipse environment (Eclipse IDE for Embedded C/C++ Developers 2022-12) for building C applications for a Raspberry Pi Pico. The Pico SDK uses CMake (cmake version 3.23.2) to create the Eclipse Makefiles.
Everything builds fine, but the C/C++ Editor is showing several symbols, coming from includes, as undefined.
I have been googling solutions, and several suggest changing the properties for include paths, but the suggested property does not exist in my project/workspace. Possible the answer was old, or for a different version of eclipse.
Again, the compile works but the C/C++ Editor marks the symbols as undefined (is that Codan?)
Is there a different include path for the editor syntax checker then the Make system? Where is that defined? Any other ideas?
The project include paths are correctly including the header files:

Related

Who can tell me what's different of the project type in Eclipse CDT?

I just install CDT plugin in Eclipse. When i start a project by click New menu in Eclipse, it shows lots of C/C++ project type:
such as: Executable/Excetuable(XL UPC)/Shared Library/Shared Library(XL UPC)....
What's different between them?
These are essentially "presets" - they have slightly different default build settings. E.g. shared library will pass the linker settings to emit .so instead of executable, XL UPC projects use compiler different then GCC by default, etc.
These settings can be changed after the project is created - but it may require a good understanding of CDT.

How can Eclipse recognize MPI artifcats without errors?

I installed Eclipse for Parallel Applications and MPI v. 2.
I created inside Eclipse a new Hello World MPI project and run it using 4 processes. I can build and run it from Eclipse, it works.
Eclipse also recognizes MPI artifacts correctly.
I configured the includes as described here:
http://help.eclipse.org/juno/topic/org.eclipse.ptp.pldt.doc.user/html/includes.html
However I'm getting a lot of errors on MPI artifact on the source code, same errors as described in the above link:
The Indexer can't find your include file
"If the indexer can't find your MPI header file, you may see problems like the following:
If your MPI header file is located in a global area that automatically gets included in your project's include path location, such as /usr/include or /usr/local/include, then things will probably work just fine without further alteration. Building and indexing will probably both operate correctly.
If you do not use mpicc or a similar build command and need to specify include and libpath information on building and linking, you will probably want to set the PLDT preferences to point to your include path for MPI, in which case, the include and link arguments will be added to your build commands."
My code works but I think it is impossible to work with al these red lines on every MPI instruction.
So my question is: how can I configure Eclipse in order to recognize MPI functions without telling me that there are errors?
Using Ubuntu 64 bit with last version of MPI and Eclipse.
I found a fix:
Right click on project -> Properties -> C/C++ General -> Paths and Symbols
On tab "Includes" click on "GNU C" and then on "Add.."
"/usr/include/mpi"
rebuild
It sounds like Eclipse does not include directories recursively.
Source: http://tinyurl.com/nkq2gwp [pages 35-36]
The link you posted seems to have all the answers that you're going to get here. Are you sure that your "mpi.h" header file is in the location you put in your include path in Eclipse? It seems that you may have the wrong path.

Include directory specification not working on Eclipse Juno

I'm using the latest 32bit Eclipse Juno. I've seen many posts about folder inclusion, but none worked for me.
The problem:
#include<iostream>
#include<osgDB/ReadFile>
#include<osgViewer/Viewer>
The compiler (GCC) reports "unresolved inclusion <iostream>" and corresponding unresolved inclusion errors for ReadFile and Viewer.
What I tried, to solve it:
In Project properties > C/C++ General > Paths and symbols > Includes. I added /usr/include/c++/4.4.4/ for all configurations and all languages. This automatically caused the values in C/C++ Build > Settings > GCC C compiler and GCC C++ compiler's includes > include paths to contain the same values.
The unresolved inclusion error persisted.
Then I tried adding iostream to the include files section below the include paths section. Still no use. Even tried closing and re-opening eclipse after the changes. Still no use.
The only other option was to specify the absolute path which worked:
#include "/home/nav/osg/osg/include/osgDB/ReadFile"
#include "/home/nav/osg/osg/include/osgViewer/Viewer"
#include "/usr/include/c++/4.4.4/iostream"
But isn't the right way to do it. Could anyone help with specifying the include paths the correct way?
I had similar problem and it was caused by the indexer not using the correct build configuration. By default, the indexer was set to use global settings, rather than project specific ones (I'm using Nsight, the version of Eclipse by Nvidia).
Go to
Project properties -> General -> Indexer
Tick
Enable project specific settings
Select
Use active build configuration
This might be irrelevant for you. I'm compiling the same project on multiple machines/OS's and hence have different include paths for each build configuration.

eclipse for android c source code - how to resolve compiler head file?

I am now using eclipse to develop driver and daemon on android platform in C code with a pandaboard, and I want to use eclipse plus CDT as an edit and browse tool.
I have imported android-source code into eclipse as a makefile project, and processing with indexer.
My problem is, since there are lots of head files for different archetecture(x86, arm, etc) like etc, etc. Eclipse reports an error like "unresolved inclusion xxx" because there are too much candidates of those files. Can eclipse analysis makefile and select the correct path like compiler if I specify a variable or identifier to notify eclipse just like a makefile option?
Can anyone help me, please?
Thanks,
-Yunfei
For your driver work checkout:
http://wiki.eclipse.org/HowTo_use_the_CDT_to_navigate_Linux_kernel_source
In general when working with a Makefile project you need to give Eclipse a hand so it knows where to find the includes and which preprocessor symbols are defined.
Right click on your project. Select properties -> C/C++ General -> Path and symbols.
Add the most important include paths and the indexer results will become much better.

CDT Eclipse: Undefined Variables even the .h file included

I'm newbie on using CDT and Eclipse. I want to make an STM32F10XX (Cortex-M3) aplication. I have a problem when I'm compiling the code, it always show undefined variables error. I used Eclipse setting as shown on Setting up Eclipse and Code Sourcery lite for STM32 Discovery Development.
But I make my own startup code, just using stm32_flash.ld and startup_stm32f10x_md_vl.S.
Is there any included or project setting missed?
discussionstackoverflowquestion
Try using the gnu99 flavor of C. Found in project Properties > C/C++ Build > Settings. MCU C Compiler Miscellaneous.
I'm guessing it is complaining about an untagged union. But this is a guess...