Author Topic: Find declaration for member function defined in the same file  (Read 2267 times)

sanpra1989

  • Guest
Find declaration for member function defined in the same file
« on: November 13, 2015, 11:48:51 pm »
I am using Code::Blocks 13.12 on Ubuntu 14.04. I have created a project with include files in a separate directory from the source. I have added the include directory in the search path for the project. The problem now is that "Find declaration of" doesn't always work for member functions. Specifically, if I try to find the declaration of a member function from a file that contains the definition, I am led to the definition. If I choose "Find declaration of" from the definition of a member function, I stay there. Finding the declaration works fine if it's a Class or a member variable, or if the member function definition is in a different file.

EDIT: The option doesn't really work for member variables or classes either. I was misled to believe so because I had tried cases where declaration and definition were the same.
« Last Edit: November 14, 2015, 12:05:12 am by sanpra1989 »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Find declaration for member function defined in the same file
« Reply #1 on: November 15, 2015, 07:45:43 am »
I am using Code::Blocks 13.12 on Ubuntu 14.04.
...
Can you try a nightly build version of C::B, 13.12 is two years ago. And please show us some sample code, thanks.
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.