Version: 4.2.1 (using KDE 4.6.3) OS: Linux In c/c++ project, #include "filename.h" means search filename.h in project firstly.If the file cannot be found,then search in system directory. Howerver,when kdevelop parsing this comment,it search in system directory firstly. If there is a header file in system directory which it's name is same as cureent project's header file,this incorrect parsing priority will cause an parsing error. Reproducible: Always
cannot reproduce, it works as you suggest for me. please attach a simple project that exhibits this behavior (i.e. two files where one is called like a common system header).
(In reply to comment #1) > cannot reproduce, it works as you suggest for me. > > please attach a simple project that exhibits this behavior (i.e. two files > where one is called like a common system header). Sorry,seems that there is no bug in search-priority for parsing header files as you say. However, there is some trouble in searching header files with imported makefile project.That is,in some makefile project,header files was in several sub-directory of the project,but it's source file include those header files with statement ' include "filename" ' ,no pathname of sub-directory.And in makefile,the project use flags like "-I sub-directory' to help compiler locate those header files,and those sub-directory has a higher priority than system header directory. Unfortunately,kdevelop cannot settle with those -I flags from imported Makefile project. So,users should add those sub-directory to the file .kdev_include_paths to help kdevelop to search those header files.But those directory in .kdev_include_paths has a lower search-priority than system header files directory. For example: Makefile Project Test: in sub-directory Test/os_include: //stdio.h inline void func() {} In directory Test: Makefile: INCLUDEPATH:=-I os_include/ test:test.cpp g++ $(INCLUDEPATH) -o test test.cpp //test.cpp #include "stdio.h" //defined by user. Not like pathname/headerfile,but is legal.Complier use -I flags to find stdio.h in project. int main() { func(); } Use make ,the proeject can compile successfully. Import this project to kdevelop,I have to add the full path name of os_include to the file .kdev_include_paths to make kdevelop parse header files in this directory,because kdevelop cannot settle with -I flags to find extra include-directory. But,kdevelop with search system include-directory firstly such as /usr/include,then directory in .kdev_include_paths. This cause , in this project ,#include "stdio.h" ,stdio was parsed to /usr/include/stdio.h
no time to confirm it now but I'll trust you with that.
Is this still valid?
This is fixed in custom-definesandincludes plugin.