Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse including Libs in a project
Eclipse including Libs in a project [message #1732145] Thu, 12 May 2016 20:29 Go to next message
Gulam Helbig is currently offline Gulam HelbigFriend
Messages: 7
Registered: May 2016
Junior Member
Hello,

my aim is just to be able to use the good possibility with eclipse as an editor to view and research code.
Here in my examp I took the sample project from ST for the F3 Cortex mikrocontroller.

My question is why do I need to copy lib content closer to the eclipse project folder to avoid unresolved include messages? (...USB_Device\CDC_Standalone\Eclipse) Here I organize all the eclipse project files.

In the first pic you can see the state with the message
index.php/fa/25890/0/
Project Explorer->Includes Default means this include path is kind of deactivated just for this example, in the next pic it is active

And in the second one without the message
index.php/fa/25891/0/
Whereas the folder "STM32303C_EVAL" contains the marked or unresolved header file

I am looking forward to exchange experiences and also get some new knowledges about eclipse with you folks

[Updated on: Sun, 15 May 2016 15:36]

Report message to a moderator

Re: Eclipse including Libs in a project [message #1732228 is a reply to message #1732145] Fri, 13 May 2016 14:22 Go to previous messageGo to next message
David VavraFriend
Messages: 778
Registered: October 2012
Senior Member
Quote:
why do I need to copy lib content closer to the eclipse project folder to avoid unresolved include messages?


Not sure what you mean by "move closer" and what the libs have to do with anything. If the project contains relative paths then the paths have to be in the right place for them to wiork.

The Indexer wants to know where the directories are that contain the headers.
The usual place to specify them is in Project --> Properties --> C/C++ General --> Preprocessor Incluse Paths, Macros etc. on the Entries tab under CDT User Setting Entries.

There seems to be other places like Path and Symbols which may also work but I don't use that one. Strikes me as redundant.


Re: Eclipse including Libs in a project [message #1732312 is a reply to message #1732228] Sun, 15 May 2016 15:26 Go to previous messageGo to next message
Gulam Helbig is currently offline Gulam HelbigFriend
Messages: 7
Registered: May 2016
Junior Member

My project directory is: C:\Keil_v5\stm32cubef3\STM32Cube_FW_F3_V1.4.0\Projects\STM32373C_EVAL\Applications\USB_Device\CDC_Standalone
The ST lib directory is: C:\Keil_v5\stm32cubef3\STM32Cube_FW_F3_V1.4.0\Drivers
So therefore I give the directory which contains the headers as:
index.php/fa/25909/0/
Whereas LIB_PATH means:
index.php/fa/25910/0/
So I set it under Project --> Properties --> C/C++ General --> Preprocessor and Symbols And this includes paths will appear under the Setting Entries "CDT Managed Build Settings Entries".
I do not know the real difference between this one and the one you are using "CDT User Setting Entries". I will try also with you possibility maybe it will work bether.

So according to your assumption it should work so far, - the headers are also there eclipse is not complaining about not existing folders which eclipse does if so. But in fact is not enough.
So I had to copy the folder "Drivers" to the following dir:
C:\Keil_v5\stm32cubef3\STM32Cube_FW_F3_V1.4.0\Projects\STM32373C_EVAL\Applications\USB_Device\CDC_Standalone\Drivers
this I meant is closer to the project.
After this the complaint about "unresolved inclusion" disappears.

For me it looks like a bug, I am not sure.
Re: Eclipse including Libs in a project [message #1732322 is a reply to message #1732312] Sun, 15 May 2016 20:49 Go to previous messageGo to next message
David VavraFriend
Messages: 778
Registered: October 2012
Senior Member
Quote:
So according to your assumption it should work so far


What assumption might that be?

Your paths are in Project --> Properties --> C/C++ General --> Preprocessor and Symbols. I said it MAY work and apparently for you it doesn't.
Eclipse documentation is rather vague and doesn't really state the purpose of the page or why there are two different pages with essentially the same content.
I think this is the page for displaying the old Discovery results. Mine is completely empty for all projects.

Discovery has been deprecated as of CDT 8.1 and superseded by "Preprocessor Include Paths, Macros etc."
according to: https://wiki.eclipse.org/CDT/User/FAQ#What_is_a_Scanner_Discovery.3F
This is the one that I use and I haven't had any problems with the Indexer.
It looks like you have Discovery enabled. I never use it as it seems to cause endless problems.

How did you end up with this project? Did you build it yourself or did you copy it from somewhere? If the latter, maybe it was for an older version of Eclipse?

A lot also depends on versions.
If you listed them, I missed it.

Use the latest version of Eclipse and CDT. (Neon is the newest. I'm using Mars.1)

Try making a new project from scratch and import the files into it.
Don't import the old .project and .cproject files.
Don't enable discovery and use the Preprocessor Include Paths, Macros etc for your include settings.





[Updated on: Sun, 15 May 2016 21:44]

Report message to a moderator

Re: Eclipse including Libs in a project [message #1735544 is a reply to message #1732322] Tue, 21 June 2016 05:40 Go to previous message
Gulam Helbig is currently offline Gulam HelbigFriend
Messages: 7
Registered: May 2016
Junior Member
Hello David,

thanks a lot for so much INPUT.
I agree with you that the eclipse documentation is vague.
There is a tiny missunderstanding. The project setup via "Preprocessor Include Paths, Macros" and Import->File System (to get the c Files) worked very fine for me so far Smile
It was for me a satisfiable state because the indexer does not complaining when runing "Search for unresolved includes" and when i started "run C/C++ Code Analysis" there also did not pop up more than 500 Bugs.
So far so good.

One of the most important features of an IDE at all is the global file search "File Search" in Eclipse. Unfortunatelly I discovered that the "File Search" in Eclipse is searching only in the C Files (Imported Files) while the main folder "Includes"
index.php/fa/26222/0/
Is completly ignored. Allthough the search Scope is set to "Workspace".
And also a nice feature ecpecially from eclipse is "Refactor". Here the same behaviour like with "File Search".

If you have a possible solution, I would owe you a lot Smile

currently I am using the newest eclipse neon (4.6.0RC3) and CDT(9.0.0.xxxx)


Update [24.06.16] Found a solution by my self, will post it later.

[Updated on: Fri, 24 June 2016 06:31]

Report message to a moderator

Previous Topic:How to view the complete string of a variable in eclipse C++?
Next Topic:what version of Eclipse is best for developing both C++ and Python?
Goto Forum:
  


Current Time: Tue Sep 25 14:34:58 GMT 2018

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

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

Back to the top