LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Mysql_connect Error, Could Anybody Tell Me When This Error Comes (https://www.linuxquestions.org/questions/ubuntu-63/mysql_connect-error-could-anybody-tell-me-when-this-error-comes-550900/)

krisvamc 05-03-2007 04:47 AM

Mysql_connect Error, Could Anybody Tell Me When This Error Comes
 


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.

deadeyes 05-03-2007 06:44 AM

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).


All times are GMT -5. The time now is 04:18 AM.