Author Topic: "Find declaration of ..." & "Find implementation of ...."  (Read 20057 times)

Offline safwen

  • Single posting newcomer
  • *
  • Posts: 5
"Find declaration of ..." & "Find implementation of ...."
« 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

Offline lexis

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #1 on: November 14, 2008, 01:30:03 pm »
Seems that you need to define additional search path where CB have to look external sources...

Offline safwen

  • Single posting newcomer
  • *
  • Posts: 5
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #2 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 :)

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #3 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

Offline safwen

  • Single posting newcomer
  • *
  • Posts: 5
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #4 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #5 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline safwen

  • Single posting newcomer
  • *
  • Posts: 5
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #6 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

Offline safwen

  • Single posting newcomer
  • *
  • Posts: 5
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #7 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

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #8 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" .

Offline Ed997

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #9 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

« Last Edit: December 25, 2008, 07:49:04 pm by Ed997 »

Offline Ed997

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #10 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".


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #11 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.
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #12 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #13 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?
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

  • Guest
Re: "Find declaration of ..." & "Find implementation of ...."
« Reply #14 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?