News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

"Find declaration of ..." & "Find implementation of ...."

Started by safwen, November 13, 2008, 07:48:59 PM

Previous topic - Next topic

safwen

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

lexis

Seems that you need to define additional search path where CB have to look external sources...

safwen

Quote from: 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...

Thanks for the answer, could you be more specific
Thanks :)

mariocup

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

safwen

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

MortenMacFly

Quote from: safwen on November 20, 2008, 01:03:46 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

safwen

Thanks !

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

Thanks

safwen

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

Jenna

Quote from: 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

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" .

Ed997

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


Ed997

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".


ollydbg

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.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Quote from: ollydbg on January 02, 2009, 05:01: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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Thanks.
I searched on Google, and only find a manual page on
http://www.mkssoftware.com/docs/man1/nm.1.asp

QuoteIn addition there is also a very nice documentation to C::B
sorry I can't find the document. Where is this document?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

bangor

Quote from: 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
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?