Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » jump to proper header file
jump to proper header file [message #1427517] Sat, 20 September 2014 09:59
Jarek Blakarz is currently offline Jarek BlakarzFriend
Messages: 6
Registered: September 2013
Junior Member
Hi
Assume the following c files:

main.c:
  #include "hdr1.h"
  void main(void)
  {
    fun();
  }


hdr1.h:
  void fun(void);


imp1.c:
  #include "hdr1.h"
  void fun(void) {}


hdr2.h:
  void fun(void);


imp2.c:
  #include "hdr2.h"
  void fun(void) {}


Makefile:
all: main.c imp1.c imp2.c
	gcc -c *.c
	gcc main.c imp1.c        !!! imp2.c not used !!!

clean:
	rm *.o a.out


When I use "Open Declaration" on fun() in main.c eclipse shows 2 candidates:
1. fun() from imp1.c
2. fun() from imp2.c

How can I force eclipse to jump directly to fun() from imp1.c.
I'm not interested in the solution when I have to manually exclude any files from indexing.
It is because I want to use Eclipse for a large C project.
I dont know the relations between specific object files, headers and modules in this project.

I suppose that there must be an option to build the index when the project is build. It is utilizing the compiler to generate index.
Is there such an option ?

thanks for help
Previous Topic:Using Directory List or Path List Build Variable types
Next Topic:Can't detach windows (e.g. console)
Goto Forum:
  


Current Time: Thu Oct 10 16:32:30 GMT 2024

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

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

Back to the top