V
Vinu
Hi,
I am facing one problem related to global variables in .so file. When
ever I access the variable the application is crashing
I have a class called services.
class services
{
services(){ }
void Add() { }
void Delete(){ }
};
In another file I declared my global variable like this
services gserviceObj;
Now I used this global variable 'gserviceObj' to access the member
function 'Add()',
gserviceObj.Add(); I am calling this Add() method of gserviceObj in
another file where the gserviceObj is declared as extern.
The application is crashing at gserviceObj.Add();. The constructor of
services is also not called till that point.
These all the files are in one .so. If I move the 'services
gserviceObj;' declaration to main and change the all the other
declarations in library(.so) to extern my application is working fine.
Is there is any way to initialize the global variables in .so files
other than declaring it in main.
Can anybody help me in this?
Thanks,
Vinu
I am facing one problem related to global variables in .so file. When
ever I access the variable the application is crashing
I have a class called services.
class services
{
services(){ }
void Add() { }
void Delete(){ }
};
In another file I declared my global variable like this
services gserviceObj;
Now I used this global variable 'gserviceObj' to access the member
function 'Add()',
gserviceObj.Add(); I am calling this Add() method of gserviceObj in
another file where the gserviceObj is declared as extern.
The application is crashing at gserviceObj.Add();. The constructor of
services is also not called till that point.
These all the files are in one .so. If I move the 'services
gserviceObj;' declaration to main and change the all the other
declarations in library(.so) to extern my application is working fine.
Is there is any way to initialize the global variables in .so files
other than declaring it in main.
Can anybody help me in this?
Thanks,
Vinu