Eclipse Kepler CDT includes external header files / recursively adds External Include Path (with subfolders)

Hi I have a built-in C project, and all the C base libraries are stored in an external folder (and not in the workspace). I can compile because the compiler knows where to look for these files, but Eclipse does not know that these files exist, and I get error messages: enter image description here

I can add one folder manually: rightClickOnProject->Properties->C/C++ Include Paths and Symbols -> Add External Include Path

For example, the file <stdint.h> is located in the folder C:\embARM7\yagarto\arm-elf\include , so I do the following:

enter image description here

This enables the eclipse error marker for <stdint.h>

But the file <stdio.h> is in the folder C:\embARM7\yagarto\arm-elf\include\sys , and I need to run the whole process again for:

enter image description here

Now the following header file is in C:\embARM7\yagarto\arm-elf\include\machine , etc. etc....

My question is: Is there a way to add an external include path with all subfolders? View "add this folder and all subfolders" / "add this folder recursively". Like C:\embARM7\yagarto\arm-elf\include\* , so I don’t need to add each folder to the folder structure manually. For one project, this is 5 minutes, but I have to do it for 10 projects, and this work sucks.

thanks

+6
source share
2 answers

I also ran into the same issue while adding many external headers to my project. Instead of using include Paths and Symbols in the project properties, I added a link to the root directory to my project, which contains all the external headers inside my subdirectory. Here's how to do it:

  • rightClickOnProject->New->Folder ,
  • Click the Advanced button in the New Folder dialog box,
  • select the Link to alternate location option,
  • Find the root directory containing all your headers, and
  • Click the Finish button.

Greetings

+6
source

I did not find this option either in Eclipse 3.7-4.3, or in MS VS2012. Apparently the workaround is to write a script in any language that will generate a recursive path for you.

For Eclipse, you can write an XML file with project settings and then import it (project properties β†’ C / C ++ General β†’ Outlines and Symbols β†’ Import Options ...). To get an idea of ​​the structure of this file, start by exporting your current project settings somewhere.

+1
source

Source: https://habr.com/ru/post/950428/


All Articles