Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: electrolot on April 19, 2009, 11:18:17 am

Title: Find declaration and Find implementation
Post by: electrolot on April 19, 2009, 11:18:17 am
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?
Title: Re: Find declaration and Find implementation
Post by: glukensoft on May 15, 2009, 09:50:28 am
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?
Title: Re: Find declaration and Find implementation
Post by: ollydbg on May 15, 2009, 10:33:12 am
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]
Title: Re: Find declaration and Find implementation
Post by: ollydbg on May 15, 2009, 10:35:38 am
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?
Title: Re: Find declaration and Find implementation
Post by: glukensoft on May 15, 2009, 01:47:10 pm
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 :)