Error on Member Initialization

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

 



Hello,

I have the following declared:

class RADCOMMGT_API CradComMgt
    {
public:
    CradComMgt(CLog* Log=NULL);
    ~CradComMgt();

	--- snip ---
	};
/***************************************/

In another file I declare this:

extern CLog Log;                   // <- Note declaration of CLog object

class radApp : public lnDaemon
    {
  public:
    virtual void DaemonInit();

  protected:
    CradComMgt m_MyServer(&Log);	// <- Note initialization
    };
/******************************************/

I get this from the compiler:

g++ -o radApp -D_LINUX -L../Libraries -I../Headers
radApp.cpp -lApp -lLog -lSock -lNetDataSvc -lradComMgt -lradCore
In file included from radApp.cpp:16:
radApp.h:24: error: invalid data member initialization
radApp.h:24: error: (use `=' to initialize static data members)
make: *** [radApp] Error 1

Compilation exited abnormally with code 2 at Fri Sep 12 20:04:53

I have Stroustrup's C++ reference manual and Ellis and Stroustrup's C++
Annotated reference, both of which say this should be a valid form to call
the CradComMgt::CradComMgt(CLog *) constructor.  What am I doing wrong here?

Thanks in Advance,
anw


[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