From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24963 invoked by alias); 13 Sep 2003 00:23:50 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 24954 invoked from network); 13 Sep 2003 00:23:49 -0000 Received: from unknown (HELO ms-smtp-01.tampabay.rr.com) (65.32.1.43) by sources.redhat.com with SMTP; 13 Sep 2003 00:23:49 -0000 Received: from csunadmin (123.66.35.65.cfl.rr.com [65.35.66.123]) by ms-smtp-01.tampabay.rr.com (8.12.5/8.12.5) with SMTP id h8D0NmYU023784 for ; Fri, 12 Sep 2003 20:23:48 -0400 (EDT) From: "Allen Williams" To: Subject: Error on Member Initialization Date: Sat, 13 Sep 2003 00:23:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <1062804110.11035.ezmlm@gcc.gnu.org> X-SW-Source: 2003-09/txt/msg00152.txt.bz2 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