Project Managers not working anymore
Andreas Pakulat
apaku at gmx.de
Mon May 7 06:17:33 UTC 2007
On 06.05.07 16:08:44, Andreas Pakulat wrote:
> Hi,
>
> I need some help from a template guru, out of a sudden the project
> managers cannot be used anymore here on my system. What seems to happen
> is that code from the macro
>
> KDEV_DECLARE_EXTENSION_INTERFACE()
>
> is not executed. What the macro does, if I understand correctly, is
> create a specialized template function called qt_extension<>() where the
> parameter given to the KDEV_DECLARE_EXTENSION_INTERFACE is used, i.e.
> for IProjectFileManager I get
>
> qt_extension<IProjectFileManager*>()
>
> however during debugging this function is not executed, but instead the
> "default" one taking a parameter "T", which returns 0 instead of a
> proper object.
>
> Now I upgraded gcc recently to 4.1.3 on Debian unstable and wonder
> wether it might be a gcc bug that the specialized template function
> isn't executed.
F....., stupid C++.
Guess what, a simple inclusion error. I added some code to
projectcontroller.cpp which used the ->extension<IProjectFileManager*>()
and projectcontroller.cpp include project.h. It doesn't include
iprojectfilemanager.h.
For whatever reasons this leads to project.cpp not getting the
qt_extension<> function in its code unit and thus the failing
extension() call when loading a project.
Adding an include for iprojectfilemanger.h in projectcontroller.cpp
before the project.h include helped.
So my conclusion: inlcude headers for extension interfaces before as
early as possible.
Andreas, who just wasted 1 night of coding for this stupid stuff
--
If your life was a horse, you'd have to shoot it.
More information about the KDevelop-devel
mailing list