M
mkarja
Hi,
I have file, let's say file2.cpp that #includes file1.h.
file1.h looks something like this. Somewhat stripped version.
---------------------------------------------
#include <mysql/mysql.h>
class file1
{
public:
file1();
~file1();
protected:
MYSQL mysql;
}
---------------------------------------------
In file2.cpp I have a line: mysql_autocommit(&mysql, 0);
The g++ gives an error: error: 'mysql' was not declared in this scope.
Shouldn't I be able to use mysql in this case from the file2.cpp
because
mysql was declared in file1.h under Protected.
Thanks for all the help. I'm a bit lost with this.
I have file, let's say file2.cpp that #includes file1.h.
file1.h looks something like this. Somewhat stripped version.
---------------------------------------------
#include <mysql/mysql.h>
class file1
{
public:
file1();
~file1();
protected:
MYSQL mysql;
}
---------------------------------------------
In file2.cpp I have a line: mysql_autocommit(&mysql, 0);
The g++ gives an error: error: 'mysql' was not declared in this scope.
Shouldn't I be able to use mysql in this case from the file2.cpp
because
mysql was declared in file1.h under Protected.
Thanks for all the help. I'm a bit lost with this.