Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Compiler does not find header files in virtual folders(Include pathes to virtual folders seem to be ignored (kinda understandable) - what's the best way to handle header files in virtual folders)
Compiler does not find header files in virtual folders [message #1823956] Sat, 04 April 2020 10:37 Go to next message
Eclipse UserFriend
I am using eclipse C/C++ 4.11.0 (build-id 20190314-1200) on ubuntu with gcc/g++

I've created a project for a unit-test application. For the first try to set this up, I've linked the source and header files of the class I want to test and its dependencies in virtual folders.

I gave it a try to add this virtual folders to the include path (I though maybe it would translate to the real path and add those to the compiler options) but it didn't work. I've solved the issue by manually setting all the real paths to the header files.

I'm just wondering: is there a way to make eclipse automatically find the paths to all the header files that are in the project (even when they are linked) and set up the compiler options?

[Updated on: Sat, 04 April 2020 10:37] by Moderator

Re: Compiler does not find header files in virtual folders [message #1824038 is a reply to message #1823956] Mon, 06 April 2020 16:10 Go to previous message
Eclipse UserFriend
Virtual folders aren't real folders and exist only in the Project View.
They are there for information purposes only.
Quote:
is there a way to make eclipse automatically find the paths to all the header files that are in the project


No and if there was it would likely be time consuming.
You would need to get the includes used then search for folders that have them.
Some library includes have duplicate names so selecting the proper directory is problematic.
Even if they were all unique, the search is massive.
My system has 2338 directories in /usr/includes.
There are places outside of that which contain headers.
For instance, glib-2.0 has headers in/usr/lib64/glib-2.0/include
You pretty much would have to scan your entire system.

Try using find to search for just one of them in /usr and see how long it takes.

However, there's nothing stopping you from writing a perl script to do the search.
Getting the results into Eclipse is another matter.

[Updated on: Tue, 07 April 2020 00:30] by Moderator

Previous Topic:Plugin: New Project Nature using existing CDT components
Next Topic:Eclipse Plugin - Target Build Project Button
Goto Forum:
  


Current Time: Thu Nov 06 10:52:12 EST 2025

Powered by FUDForum. Page generated in 0.05576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top