Hi,
I'm using codeblocks rev 4450, but I encountered the problem in earlier versions as well.
I created a project with 2 files: a.h and a.cpp with the following contents:
a.h:
#ifndef A_H_INCLUDED
#define A_H_INCLUDED
struct str_1
{
int a;
char b;
};
class A
{
public:
A() {};
void InitStruct(int, char);
void InitInt(int);
protected:
struct str_1 m_Struct1;
int m_Int;
};
#endif // A_H_INCLUDED
a.cpp:
#include "a.h"
void A::InitStruct(int i, char c)
{
m_Struct1.a = i;
m_Struct1.b = c;
}
void A::InitInt(int i)
{
m_Int = i;
}
The problem is that "Find declaration of: m_Struct1" does not work, i.e. it's reported as not found, whereas the same thing works for m_Int. But if I do the following changes in a.h then "Find declaration of: m_Struct1" works:
struct str_1
{
int a;
char b;
};
becomes:
typedef struct str_1
{
int a;
char b;
} AStruct;
and in class A:
struct str_1 m_Struct1; is replaced with AStruct m_Struct1;
Code completion does not work at all for variables of type structure, i.e. after typing "." after m_Struct1 no pop-up menu with the structure members appear.
Regards