static members in c++ class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, I want to make a static members in a C++ class
and declare it as a private member:
static iKernel   * inst;
,
after the class definition in the header file I define the variable:

iKernel * iKernel::inst=0;

When I compile the program I get the error:

ibroker.o(.bss+0x18):/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/ext/mt_allocator.h:450:
multiple definition of `imaker::iBroker::inst'
imaker5.o(.bss+0x0):/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/ext/mt_allocator.h:448:
first defined here

When I look at mt_allocator.h line 448 it shows:
  static pool_type&
      _S_get_pool()
      {
	static pool_type _S_pool;
	return _S_pool;
      }

Can anybody explain this ?
IB






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux