Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: safwen on November 13, 2008, 07:48:59 pm

Title: "Find declaration of ..." & "Find implementation of ...."
Post by: safwen on November 13, 2008, 07:48:59 pm
Hi everybody!

I am new in C::B,
I am trying to find a way to access the declaration/definition of used types, functions, declarations... in external file (that are not necessary opened)
I noticed that C::b sometimes when try to find the implementation of a function or... it opens the externel file that contains the implementation which is great and very time-saving!
I was on Anjuta before, but Anjuta does not do this for external files, and only refers to files in the same projetc.

The problem is that c::b does not always find the implemetation/declaation of an entity. (Not found:.....)
So how to make c::b find any used  implemetation/declaration in an #included file?
how c::b works exactly to trace used entity.
Should I add libraries or directories, how and under what circumstances.
Should the file be in the project directory?.....
Can Anjuta do the same thing?
I need some clarification, does someone can help?

In fact, I am searching a behaviour like Visual Studio C++ 6, in locating and finding the definition/declarations of externel files.

Thanks for all
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: lexis on November 14, 2008, 01:30:03 pm
Seems that you need to define additional search path where CB have to look external sources...
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: safwen on November 14, 2008, 02:20:57 pm
Seems that you need to define additional search path where CB have to look external sources...

Thanks for the answer, could you be more specific
Thanks :)
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: mariocup on November 14, 2008, 02:37:45 pm
Hi safwen,

if you want that the codecompletion and parsing (open include implementation/declaration) works properly then you have to add the path to the search path of the compiler (e.g. Settings->Compiler & Debugger->Search Directories (Tab) for your compiler. This will add this search path globally. If you want to add them only for your project, then you have to select the project built options dialogue and add them to the search directories tab.

Bye,

Mario
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: safwen on November 20, 2008, 01:03:46 pm
Thanks guys!
Thanks mariocup

It's working very well on the very cool editor code::blocks,
But there is something missing and I am asking you about it:
For the the calls of embedded functions,types...in libraries, I see that the cb does not recognize them.
It seem to be correct because there is no textcode, implementation visible for these functions,types...
Is it possible at least to find the libray that contains that function, type...?

Ps: compared to eclipse cdt which one is best in codecompletion and parsing?

Thanks
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: MortenMacFly on November 20, 2008, 01:24:18 pm
Is it possible at least to find the libray that contains that function, type...?
You can use the symbol table plugin for that purpose.
It uses the command line tool "nm" (ships with MinGW/GCC) to either:
- search a given directory with 1..n libs for a symbol,
or:
- search for a specific symbol in a single library/object file...
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: safwen on November 20, 2008, 01:42:26 pm
Thanks !

But how to install that plugin and how to install a new plugin in general ?

Thanks
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: safwen on November 20, 2008, 02:06:22 pm
Hi,

Does someone know how to install an additional cb plugin, because I can't find any reference on that topic? did I searched well?

Thanks
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: Jenna on November 20, 2008, 02:23:07 pm
Hi,

Does someone know how to install an additional cb plugin, because I can't find any reference on that topic? did I searched well?

Thanks

If you are on windows, you can either use a recent nightly build, or reinstall the C::B 8.02 release and chose to install contrib-plugins.

On linux the contrib-plugins are in packages called something like  "codeblocks-contrib" .

To start the plugin click on "Plugins -> Symbol Table Plugin" .
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: Ed997 on December 25, 2008, 06:27:02 pm
11-10 am  12-25-08

   Hi I just installed 8.02, including core pluggins and all contrib pluggins.

Though Plugins/Manage Plugins shows that the "Symbol Table Plugin" is enabled, it does not show up in Settings/Environment.
This is causing me problems in debug mode.

What am I doing wrong. How do I get to the Options tab of the Symbol Table Plugin?

Thanks, Ed

Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: Ed997 on December 29, 2008, 07:37:11 pm
12-20 pm  12-29-08

  Answer to Ed997 Post,

  The Symbol Table plugin settings can be accessed as follows: (Note in the Installation this is Not a Core Pluggin)

"Plugins/Symbol Table Plugin"

The pluggin at this time is not accessed from ...... "Environment/Settings".

Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: ollydbg on January 02, 2009, 05:01:46 pm
Hi, all.
I searched wiki, and find that the term "Symbol Table" is in red color which means no more details can be found.
It just means : A simple graphical interface to the GNU symbol table displayer (nm).

If someone is good at this tool can add something in the wiki page.

By the way, many plug-ins of the wiki page is in red color, and there documents are insufficient. This is a drawback to make C::B more widely spreaded. And will give beginner a bad taste of usage. So, writing wiki are more encouraged.
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: MortenMacFly on January 02, 2009, 06:06:46 pm
If someone is good at this tool can add something in the wiki page.
I did this plugin but did not expect that one would need a big manual for this. In the end it's a very simple task.

But: "nm" has a manpage to my knowledge. In addition there is also a very nice documentation to C::B - IMHO way better than the WiKi and done by mariocup.
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: ollydbg on January 03, 2009, 04:22:39 am
Thanks.
I searched on Google, and only find a manual page on
http://www.mkssoftware.com/docs/man1/nm.1.asp

Quote
In addition there is also a very nice documentation to C::B
sorry I can't find the document. Where is this document?
Title: Re: "Find declaration of ..." & "Find implementation of ...."
Post by: bangor on April 21, 2011, 03:29:23 pm
Hi safwen,

if you want that the codecompletion and parsing (open include implementation/declaration) works properly then you have to add the path to the search path of the compiler (e.g. Settings->Compiler & Debugger->Search Directories (Tab) for your compiler. This will add this search path globally. If you want to add them only for your project, then you have to select the project built options dialogue and add them to the search directories tab.

Bye,

Mario
In a project ,I want to find the implementation of opencv function(say imshow),but alway not found, and I have add the path of opencv source code path as described above. Anyone can give me hellp?