Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4513 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61804 invoked by uid 1010); 17 Sep 2003 15:05:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61778 invoked from network); 17 Sep 2003 15:05:48 -0000 Received: from unknown (HELO mx.thebrainroom.net) (65.200.24.98) by pb1.pair.com with SMTP; 17 Sep 2003 15:05:48 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 6BB42148808B; Wed, 17 Sep 2003 08:05:28 -0700 (PDT) Received: from zaneeb.brainnet.i (gate.thebrainroom.net [195.149.29.154]) by mx.thebrainroom.net (Postfix) with ESMTP id 792281488089; Wed, 17 Sep 2003 08:05:19 -0700 (PDT) Received: from TITAN (titan.brainnet.i [192.168.2.7]) by zaneeb.brainnet.i (8.11.6/8.11.6) with SMTP id h8HF5cr01323; Wed, 17 Sep 2003 16:05:38 +0100 Message-ID: <034401c37d2d$26eccf80$0702a8c0@TITAN> To: , "Igal Ore" Cc: References: <20030917141743.65402.qmail@pb1.pair.com> <20030917142722.84139.qmail@pb1.pair.com> <033101c37d2a$b6bbdf50$0702a8c0@TITAN> <3F687746.8010208@cipherquest.com> Date: Wed, 17 Sep 2003 16:05:37 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,QUOTED_EMAIL_TEXT,REFERENCES version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] Re: C++ extension question From: wez@thebrainroom.com ("Wez Furlong") No, that only prevents the file being included twice in the same .cpp file. The solution to this problem is to move the function bodies into their own .cpp file: foo.h: class Foo { Foo(); ~Foo(); }; fooclass.cpp: Foo::Foo() { ... } Foo::~Foo() { ... } --Wez. ----- Original Message ----- From: "Igal Ore" To: ; "Wez Furlong" Cc: ; Sent: Wednesday, September 17, 2003 4:01 PM Subject: Re: [PHP-DEV] Re: C++ extension question > you are right , and for those cases there a preprocessor protection > #ifndef DO_NOT_MAKE_BOBO > #define DO_NOT_MAKE_BOBO > > class Foo{ > Foo(){...} > ~Foo(){...} > }; > #endif > > > isn't it? > > Wez Furlong wrote: > > This sounds like the "rookie" mistake of declaring your functions inline in > > the class definition in the header files, and then including those headers > > in multiple files. > > > > eg: foo.h: > > > > class Foo { > > Foo() { ... } > > ~Foo() { ... } > > }; > > > > foo.cpp: > > #include "foo.h" > > > > bar.cpp: > > #include "foo.h" > > > > == linker problems. > > > > --Wez.