Hi Robert, you're seeing this behavior because includes and include paths don't matter much when you're jumping from declaration to definition with 'follow symbol'.
Since there's generally no way to know which source file will have the implementation of a function declared in a header, Creator scans every file it knows, reporting back the first matching definition it finds. (see Snapshot::findMatchingDefinition) So the behavior you're seeing is not a bug in the include path resolution, but simply the find-definition code not prefering your project's source files. I don't have the time to fix it, but have made https://bugreports.qt.nokia.com/browse/QTCREATORBUG-6137 . Regards, Christian On Monday 19 September 2011 09:49:35 ext Schimkowitsch Robert wrote: > This is getting really weird: > > I have a template class in a header file > Among others, there are two methods in the public section: > > template<class valueT, class deltaT = valueT> > class CLib_RangeObject : > public CLib_RangeObjectBase, > public ILib_Range<valueT, deltaT> > { > public: > // More method declarations... > virtual valueT min() const; > virtual void setMin(const valueT &value); > // More method declarations... > }; > > Both of them are defined further down in the same header file: > > template<class valueT, class deltaT> > valueT CLib_RangeObject<valueT, deltaT>::min() const > { > // Some code - doesn't affect the problem > } > > template<class valueT, class deltaT> > void CLib_RangeObject<valueT, deltaT>::setMin(const valueT &value) > { > // Some code - doesn't affect the problem > } > > > When I go to the declaration of setMin and hit F2, Creator navigates to > the method definition as shown here. > When I go to the declaration of min and hit F2, I get the error "Cannot > open <copy of my file in include path> for reading: No such file or > directory" > > Now why would Creator decide on a method-by-method base where to jump? > As said previously, the definition is in my own file, so why not look > there first? > Plus, I added "." as first include path, so even if Creator goes the > include path way, it should find the very same file - not the one in the > central include path. > > > This is extremely annoying. Any ideas how to fix it? > > Kind regards > > > Robert Schimkowitsch > > > ########################################################################### > ########## > > This message and any attachments are solely for the use of the intended > recipients. They may contain privileged and/or confidential information or > other information protected from disclosure. If you are not an intended > recipient, you are hereby notified that you received this email in error > and that any review, dissemination, distribution or copying of this email > and any attachment is strictly prohibited. If you have received this email > in error, please contact the sender and delete the message and any > attachment from your system. > > Thank You. > > ########################################################################### > ########## > > _______________________________________________ > Qt-creator mailing list > [email protected] > http://lists.qt.nokia.com/mailman/listinfo/qt-creator _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-creator
