Author Topic: Code navigation in thrid-party library  (Read 7051 times)

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 61
Code navigation in thrid-party library
« on: April 05, 2013, 09:53:36 pm »
How can I point CB to location of the library sources to get ability to use "Find implementation" for this library functions in my project?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Code navigation in thrid-party library
« Reply #1 on: April 05, 2013, 11:10:34 pm »
It should follow the includes in you project automatically. So there are no setup requirements.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Code navigation in thrid-party library
« Reply #2 on: April 06, 2013, 08:57:30 am »
But if the implementation is in a source-file and not in a header, you will need the sources so the CodeCompletion-plugin (which offers this functionality) can parse them.
And they must be either part of your project or in a project which is also opened in the same workspace as your project.
In this case you need to switch on the option to parse the whole workspace (as far as I know).

But find declaration should work in any cases,because to use the lib, you also need the include headers anyway.
Note, this will probably not work (correctly) with templates and if you use something like pkg-config or wx-config.
« Last Edit: April 06, 2013, 08:59:19 am by jens »

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Code navigation in thrid-party library
« Reply #3 on: April 06, 2013, 02:27:04 pm »
So there is no options to force CC to parse files that is not in my project or workspace? May this feature be realised in future?
By the way feature to point CC real location of the headers and defining of preprocessor symbols like -DUSE_BLABLA is would be useful too in cases when I use "pkg-config or wx-config" or external Makefiles.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Code navigation in thrid-party library
« Reply #4 on: April 06, 2013, 02:38:11 pm »
Parsing external makefiles is no option for CC.
There is no common way to search for special stuff.

Header files used by your project get parsed already (so "Find declaration" will work in most cases), but the implementation is usually not in the headers, but in the source-files.
And these files are normally not shipped with the development packages.

The stuff provided by wx-config and pkg-config might get parsed already, I'm not sure about this.

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Code navigation in thrid-party library
« Reply #5 on: April 06, 2013, 04:28:20 pm »
Parsing external makefiles is no option for CC.
There is no common way to search for special stuff.
I don't suggest to parse Makefiles, I`m suggest to add option to manually specify some path and defines to CC.

Header files used by your project get parsed already (so "Find declaration" will work in most cases), but the implementation is usually not in the headers, but in the source-files.
And these files are normally not shipped with the development packages.
I`m knew difference between headers and sources ;) I'm want to have ability to find implementation of functions in libraries with sources. For example in wxWidgets.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Code navigation in thrid-party library
« Reply #6 on: April 06, 2013, 04:37:34 pm »
For parsing additional includes see "Project -> Properties -> C/C++ parser options".
As fa as I know, there is no option (yet) to parse additional sources.

But this might be a useful feature request.

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Code navigation in thrid-party library
« Reply #7 on: April 07, 2013, 08:31:08 am »
Thanks jens!
I will open corresponding feature request.