From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29464 invoked by alias); 4 Jan 2008 23:41:55 -0000 Received: (qmail 29453 invoked by uid 22791); 4 Jan 2008 23:41:53 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Jan 2008 23:41:36 +0000 Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id m04NfVUH021894 for ; Fri, 4 Jan 2008 23:41:32 GMT Received: from rv-out-0910.google.com (rvfc24.prod.google.com [10.140.180.24]) by zps35.corp.google.com with ESMTP id m04NeFXk006335 for ; Fri, 4 Jan 2008 15:41:31 -0800 Received: by rv-out-0910.google.com with SMTP id c24so5243064rvf.16 for ; Fri, 04 Jan 2008 15:41:30 -0800 (PST) Received: by 10.140.169.6 with SMTP id r6mr9228189rve.210.1199490090870; Fri, 04 Jan 2008 15:41:30 -0800 (PST) Received: by 10.141.129.12 with HTTP; Fri, 4 Jan 2008 15:41:30 -0800 (PST) Message-ID: <29bd08b70801041541u67808021i734790a9211eee7@mail.gmail.com> Date: Sat, 05 Jan 2008 20:02:00 -0000 From: "Lawrence Crowl" To: "Bruno Moreira Guedes" Subject: Re: Dynamic Libraryes, C++ and Objective-C Cc: gcc-help@gcc.gnu.org In-Reply-To: <3fdd6ce00801011903x1b1b63egcd479de40c0c5e08@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3fdd6ce00801011903x1b1b63egcd479de40c0c5e08@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00040.txt.bz2 On 1/1/08, Bruno Moreira Guedes wrote: > Hello People, > > I'm highly interested in developing a "very-pluggable API", to offer a > "Java API-like"(just LIKE hehehe) for C++. So, I asked myself "how > could I dynamic load classes?". During my research about how to > construct that, I break into that step, and it's getting too hard to > pass... > > After a little research, I heard about a 'ugly' method which consists > of creating a virtual/pure-virtual and class using a helper function > to make the new/delete operations. > > But I want to "split" the API into a base library, statically linked > with the base libraries, and the "pluggable parts", where each part > consists of a set of many classes. So, creating a virtual class for > each class don't make sense... > > Researching anymor I heard about a Objective-C ability of creating and > modifying classes during the runtime. But I don't know Objective-C > very-well and I don't know how to 'mix' it with C++ code... As an > alternative, if someone could help-me about using GCC to mix that, I'm > grateful... > > But returning to the main problem, I want to use the headers which I > have of the API parts, of course... And the I get the idea of letting > the symbols to be resolved during the library loading stage, and not > during the compile time... > There's anyway to don't resolve the symbols during the compile-time??? Your best bet is probably to define a simple function that is a factory for implementation classes derived from the interface's abstract base classes. Each plug-in would define the factory. -- Lawrence Crowl