From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 9 14:41:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D61D116A4CF; Thu, 9 Sep 2004 14:41:26 +0000 (GMT) Received: from cicero1.cybercity.dk (cicero1.cybercity.dk [212.242.40.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78E0F43D62; Thu, 9 Sep 2004 14:41:26 +0000 (GMT) (envelope-from db@traceroute.dk) Received: from user5.cybercity.dk (user5.cybercity.dk [212.242.41.51]) by cicero1.cybercity.dk (Postfix) with ESMTP id 670B97E3D12; Thu, 9 Sep 2004 16:41:25 +0200 (CEST) Received: from [10.0.0.3] (port132.ds1-arsy.adsl.cybercity.dk [212.242.239.73]) by user5.cybercity.dk (Postfix) with ESMTP id 4674B3A1C0C; Thu, 9 Sep 2004 16:41:25 +0200 (CEST) From: db To: Maxime Henrion Date: Thu, 9 Sep 2004 16:42:34 +0200 User-Agent: KMail/1.7 References: <200409091630.36721.db@traceroute.dk> <20040909143621.GD13294@elvis.mu.org> In-Reply-To: <20040909143621.GD13294@elvis.mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409091642.36082.db@traceroute.dk> cc: hackers@freebsd.org Subject: Re: Runtime loading X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2004 14:41:27 -0000 On Thursday 09 September 2004 16:36, you wrote: > > In my C++ program I need to load some files/classes at runtime, so that > > users can add "plugins" without recompilling my program. What functions > > should I use? I'm using FreeBSD 5.3-beta2 btw. > > I'm not sure about C++, though I guess you could use the same functions as > in C. If that's true, then you should use the dlopen() family of > functions. They are quite portable, since you'll find the same functions > under all the *BSD, Linux and Solaris. Be aware that with Linux and > Solaris, those functions are located in libdl, while they are found in libc > on the *BSD systems. Ok, thanks :-) br db