Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

several issues with "open #include file ..."

(1/7) > >>

killerbot:
I will also create a bug report with attached project on the SF page.

Open include file does NOT work for C++ header files.

When looking at the code of the "Open include part" of the codecompletion plug-in, there are several directories added to a list, where a search will happen to find the "#include file". This is done by calling Parser::AddIncludeDir() fromp within NativeParser::AddCompilerDirs()
These are :
 - the project's base path
 - include dirs specified in the project
 - include dirs of the target
 - include dirs from the compiler

In the attached example (with default installation of CB 'with Mingw'; note : also happens with cvs build), these are
 - <MyProjectPath>   (the project base)
 - <MyProjectPath>\inc (include dir specified in the project)
 - C:\Program files\CodeBlocks\include  (the compiler include dir)

Well ,the last one is incorrect, at that level you can for example find "stdio.h", but not the real C++ header, they are in :
C:\Program files\Codeblocks\include\c++\3.4.4  !!!
When I add this include dir to the gnu compiler settings I can "open include file iostream", otherwise I don't.

I think there are 2 solutions :
1) the include paths for the gnu compiler in the colmpiler setting should have this entry also

2) apparently the compiler is able to find those header files during compilation, does it have this extra path build in ? or can it figure it out otherwise (environment?) -> if CB also could figure this out, it could registrate also this/these extra path(s) ??


The second problem is :
In the attached project switch to the digital mars compiler (includes path for that compiler are for example : C:\dm and c:\dm\stlport\stlport).
Save the project, close it, open it
The include paths of the digital mars are not added to the parser::AddIncludeDir(), once again it are the include paths of the gun compiler which are added.


What do you think ? And ... when could it be fixed ? ;-)

The fix for problem 1 through solution 1 could be simple, I guess. Since during the autodetect CB finds out where the gnu compiler is.

kind regards,
Lieven


[attachment deleted by admin]

mandrav:

--- Quote ---1) the include paths for the gnu compiler in the colmpiler setting should have this entry also
--- End quote ---

Then we would face many problems when we make a release with newer MinGW...
The compiler knows how to locate its files, no need for us to help ;)


--- Quote ---2) apparently the compiler is able to find those header files during compilation, does it have this extra path build in ? or can it figure it out otherwise (environment?) -> if CB also could figure this out, it could registrate also this/these extra path(s) ??
--- End quote ---

It's built-in to the compiler...


--- Quote ---The second problem is :
In the attached project switch to the digital mars compiler (includes path for that compiler are for example : C:\dm and c:\dm\stlport\stlport).
Save the project, close it, open it
The include paths of the digital mars are not added to the parser::AddIncludeDir(), once again it are the include paths of the gun compiler which are added.
--- End quote ---

If it is indeed so, then it's a bug. It 'll be fixed after we move the repository.

killerbot:
so for the first problem that means if we don't add it, we can't open c++ headers, like iostream, vector, ... :(

That would be a serious lack in functionality.

Question, what would CB do, when I have 2 gnu compilers installed, lets say 3.4.4 and 4.0.0 ?
Assume, an installation of CB is done, with the distribution that does not contain the gnu compiler.


Cheers,
Lieven

mandrav:

--- Quote ---so for the first problem that means if we don't add it, we can't open c++ headers, like iostream, vector, ...
--- End quote ---

You can always add it yourself ;)


--- Quote ---Question, what would CB do, when I have 2 gnu compilers installed, lets say 3.4.4 and 4.0.0 ?
--- End quote ---

It will use the one that is configured, probably by its auto-detection.

killerbot:
hmm, ironical critical grumbling noise for the solution  :P

Navigation

[0] Message Index

[#] Next page

Go to full version