This forum has been archived. All content is frozen. Please use KDE Discuss instead.

jump to proper header file

Tags: None
(comma "," separated)
pawelpor
Registered Member
Posts
1
Karma
0

jump to proper header file

Sat Sep 20, 2014 10:37 am
Hi
I wonder if kdevelop can do the following.
Assume the following C files:

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


hdr1.h:
Code: Select all
  void fun(void);


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


hdr2.h:
Code: Select all
  void fun(void);


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


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

clean:
        rm *.o a.out


Now when browsing main.c I want to jump to fun() definition.
Here the question. Will kdevelop show the list of 2 candidates to fump to:
1. fun() from imp1.c
2. fun() from imp2.c

or it will jump to the fun() from imp1.c which is correct in this example.

I'm not interested in the solution when I have to manually exclude any files from indexing.
It is because I want to use KDevelop 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.

thanks for help
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: jump to proper header file

Sat Sep 20, 2014 11:18 am
It can't do that, for that it would have to understand how exactly your makefile compiles your project and that's not easily possible in the general case. You'll have to resort to exclusions.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]