Quote:
Originally Posted by krisvamc
Hi,
I am trying to compile one file. I am getting mysql error.
Could anybody tell me when this error comes and how to rectify this.
The error is :
handling.cc: In function ‘bool CreateDatabase()’:
handling.cc:65: error: ‘mysql_connect’ was not declared in this scope
handling.cc: In function ‘bool OpenDatabase()’:
handling.cc:122: error: ‘mysql_connect’ was not declared in this scope
make: *** [handling.o] Error 1
kris.
|
It means that the variable is not in the scope.
So if you declare a variable in a function, then it will not be accessible outside of it.
If you want the variable to be available for all functions, put the member(variable) declaration out of any method (function).