Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer detects wrong include file of two possibilities
Indexer detects wrong include file of two possibilities [message #989026] Tue, 04 December 2012 10:54 Go to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Hello.

I'm using Eclipse Juno with CDT 8.1 on Windows.

I'm developing software mainly for a Target microcontroller. But I have the possibility to generate code for a Simulation of the code on a PC.

To separate between 'Target' and 'Simulation' I use two different Output directories:
'Target' = 'bin'
'Simulation' = 'sim'.

Underneath those directories there is a similar tree with a header file of the same name but different content ('Target' or 'Simulation'):

<Project dir>
- bin
-- include
--- generated
---- autoconf.h
:
:
-sim
-- include
--- generated
---- autoconf.h
:

Somewhere in my code there is

#include <generated/autoconf.h>

And here is my problem:

When I 'follow' this include (F3 or Strg-Click), I ALWAYS get the 'autoconf.h' from sim. And therefore the Eclipse Indexer is highlighting for 'sim' and not for 'bin' as I request.

I have already inserted in
<Project Properties> | C/C++ General | Paths and Symbols | Includes | GNU C
the entry

<Project path>/bin/include


What do I have to do to create a Configuration, in which the upper 'F3' brings me to the include of the bin folder???

TIA
Dirk


Best regards
Dirk
Re: Indexer detects wrong include file of two possibilities [message #989075 is a reply to message #989026] Tue, 04 December 2012 14:33 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You should create two build configurations
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_manage_dialog.htm?cp=11_4_7_0_2_0

Then in Project Properties set the source location for every build config
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_pns_src.htm?cp=11_4_7_0_4_5_4

In C/C++ Project Properties, C/C++ Indexer
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_idx.htm?cp=11_4_7_0_4_3

you can select which build configuration the indexer will use.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indexer detects wrong include file of two possibilities [message #989082 is a reply to message #989075] Tue, 04 December 2012 15:01 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Axel Mueller wrote on Tue, 04 December 2012 15:33
You should create two build configurations
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_manage_dialog.htm?cp=11_4_7_0_2_0


Yes . . . I understand that.

Axel Mueller wrote on Tue, 04 December 2012 15:33
Then in Project Properties set the source location for every build config
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_pns_src.htm?cp=11_4_7_0_4_5_4


This I don't understand.

Here is my project structure (also as attachment):

index.php/fa/12593/0/

'bin' and 'sim' are in the SAME project parallel by the source folders.
The 'Source Location' for BOTH build configs would therefore be 'GV642_Premium_Bosch' !?!?

Axel Mueller wrote on Tue, 04 December 2012 15:33
In C/C++ Project Properties, C/C++ Indexer
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_idx.htm?cp=11_4_7_0_4_3

you can select which build configuration the indexer will use.


If the second point above is clear, then I fully understand the last point.


THX for the help.

Regards
Dirk


Best regards
Dirk
Re: Indexer detects wrong include file of two possibilities [message #989416 is a reply to message #989082] Thu, 06 December 2012 07:26 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Sorry . . . but *BUMP*.

At least I would like to know, how/why the Indexer prefers the 'sim' directory over the 'bin' directory?
And how can I change/revert that 'attitude'?

THX in advance.


Best regards
Dirk
Re: Indexer detects wrong include file of two possibilities [message #989507 is a reply to message #989082] Thu, 06 December 2012 14:36 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You can define exclude filters for the source location.
e.g.
Config1
source location GV642_Premium_Bosch
exclude bin

Config2
source location GV642_Premium_Bosch
exclude sim

see
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_pns_src.htm?cp=11_4_7_0_4_5_4


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indexer detects wrong include file of two possibilities [message #989654 is a reply to message #989507] Fri, 07 December 2012 08:17 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Hello Axel,

first THX for the reply.

I'm sorry, but that didn't work either.
I have excluded 'sim' in 'Source location' and did a 'Rebuild Index'.
Then I have navigated again and I ended again falsely in 'sim'.
This screenshot is the situation directly after the last 'F3':

index.php/fa/12630/0/

Even as 'autoconf.h' is (obviously) excluded, it is highlighted and opened in an editor. Confused

And here are the 'Indexer' settings in the PROJECT:

index.php/fa/12631/0/

Is there the possibility of a bug in CDT?

My only way to get it working properly is to RENAME the 'sim' folder and 'Rebuild Index'.


Best regards
Dirk
Re: Indexer detects wrong include file of two possibilities [message #989687 is a reply to message #989654] Fri, 07 December 2012 10:19 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Did you add sim folder in Project Properties->General->Paths and Symbols->Includes?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Indexer detects wrong include file of two possibilities [message #989932 is a reply to message #989687] Mon, 10 December 2012 07:07 Go to previous message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Nope.

On the opposite I've even added 'bin' and 'bin\generated' as Includes with no success.


Best regards
Dirk
Previous Topic:Eclipse Sequoya fails to resolve header files
Next Topic:Definition of __STDC_HOSTED__ in Eclipse?
Goto Forum:
  


Current Time: Sun Dec 21 18:47:48 GMT 2014

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

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