Header file out of scope problem
Ok so my sources are like this:
main.cpp
1 2 3 4 5
|
int main()
{
widget w;
}
|
widget.h
1 2 3 4 5
|
#include <"custom header file")
void customfunction (int);
void anotherfunc(int);
|
widget.cpp
1 2 3 4 5 6 7 8 9 10 11
|
#include <widget.h>
void widget::customfunction (int a)
{
bigfunc (); //bigfunc is in custom header file
}
void widget:: anotherfunc(int b)
{
//do stuff
}
|
"custom header file"
1 2 3 4
|
void bigfunc ()
{
anotherfunc (9);
}
|
Problem is that in the custom header file it says anotherfunc was not declared in this scope.
What (stupid) thing am I doing wrong here?
"custom header file" should look like this:
void bigfunc ();
The full definition should be in "custom cpp file".
Even though custom header file just contains my own custom functions (nothing to do with classes)?
Topic archived. No new replies allowed.