News:

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

Main Menu

Find declaration and Find implementation

Started by electrolot, April 19, 2009, 11:18:17 AM

Previous topic - Next topic

electrolot

I have included some files from directory outside project directory. I add in "Search directory" correct directory of included files. I do it in properites of project and in Settings of C::B.
Find declaration (implementation) does not work in this case.
Could you give some advise?

glukensoft

Have the same problem with C::B  8.02 at Ubuntu (binary package from repos).
I was unable to find declaration of 'sleep' function explicitly declared in 'unistd.h' (always obtaining 'Not found:' message) in this simple piece of code:

#include <iostream>
#include <unistd.h>
using namespace std;

int main()
{
    sleep(1);
    cout << "Hello world!" << endl;
    return 0;
}

though I added '/usr/include' and '/usr/include/c++/4.3.3' in global list of search directories, as wel as in the project options too.  Maybe there are some external dependencies (ctags ?) need to be installed, or patches need to be applied on C::B source code, or anything else?

ollydbg

No, ctags is not need.

See the wikipage here:

http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#Code-Completion_debug_tool_dialog

I test your code in MinGW, there is no function named "sleep", there is only "usleep" in that header file.

see the snapshot below:





[attachment deleted by admin]
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.

ollydbg

to electrolot:

You can add the search path in "build options ->search directory->compilers", It works quite well in my system.

Could give a simple test case?
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.

glukensoft

Thank you for reply,

I went on with experiments with source code examples and have find out that 'Find declaration' doesn't work for my *cpp and *h files with standart library functions (I've tried with '*sleep' and 'pthread_*' functions and always got 'Not found' error message); but works perfectly with my own classes and functions, as well as finding standart C functions' and types' declarations in standart *h files placed in /usr/include.

So i am not really sure if 'Find declaration's behaviour is a bug or a feature :)