Hello,
I would like to declare a variable as static in MyServiceImpl so it is shared across class instances. I tried
static Dataset *idx;
The class does compile without the static keyword but fails to compile with static keywork. Any ideas??
Thanks,
Saleem
[Solved] Static Variable in MyServiceImpl
[Solved] Static Variable in MyServiceImpl
Last edited by Hagar Delest on Tue Jul 10, 2012 11:21 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 3.4.0
Mac OS X 10.5.8
Mac OS X 10.5.8
Re: Static Variable in MyServiceImpl
Actually sorry for this post. I believe I have figured out the issue.
OpenOffice 3.4.0
Mac OS X 10.5.8
Mac OS X 10.5.8
- Hagar Delest
- Moderator
- Posts: 33629
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Static Variable in MyServiceImpl
Can you post your findings? It may help other users.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
Re: Static Variable in MyServiceImpl
Sure. It was just a C++ issue. I declared the type to be static and then was assigning a value of NULL to it in the class constructor. This is not permitted in C++ since the variable is shared accross all objects.
OpenOffice 3.4.0
Mac OS X 10.5.8
Mac OS X 10.5.8