From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16283 invoked by alias); 5 Jan 2012 17:57:41 -0000 Received: (qmail 16272 invoked by uid 22791); 5 Jan 2012 17:57:40 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp-154-thursday.nerim.net (HELO maiev.nerim.net) (194.79.134.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jan 2012 17:57:27 +0000 Received: from [192.168.32.136] (adminlm-146-106.cnt.nerim.net [194.79.146.106]) by maiev.nerim.net (Postfix) with ESMTP id E56AC2E016 for ; Thu, 5 Jan 2012 18:57:26 +0100 (CET) Message-ID: <4F05E486.2040905@alamaison.fr> Date: Thu, 05 Jan 2012 17:57:00 -0000 From: Benjamin Raverdy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: calling a function of a shared library from another shared library Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2012-01/txt/msg00022.txt.bz2 Hi, I have a main application (lmApplication) (compiled with the -rdynamic option) calling a dynamically shared lirbary, that is calling back lmFromCaller() that belong to lmApplication. lmApplication --------------------------------> lmLib.so dyn load with dlopen | | LmFromCaller() <----------------------------------- As I use rdynamic, that works fine. Now I want to do something similar, but having a shared library lmPlugin.so instead of the main application. Hence I have a main application (lmApplication) calling a dynamically shared lirbary lmPlugin.so. This plugin is itself calling another shared library lmLib.so that calls the method LmFromCaller() of lmPlugin.so lmApplication --------> lmPlugin.so ------------------------> lmLib.so dyn load with dlopen dyn load with dlopen | | lmFromCaller() <---------------------------- I get an error, spite I compiled everything with the -rdynamic option: ./test: symbol lookup error: /home/benjaminr/Desktop/example_dynamic_load/LmLib/Debug/liblmLib.so: undefined symbol: _Z32lmFromCallerv If you would find it useful to understand my attempts, I can give you the code and the way I compiled it. Regards, (Sorry I have posted this on other places in the gcc mailing lists before finding this one) -- Benjamin Raverdy VFX software engineer La Maison 13-15 rue Gaston Latouche 92 210 Saint-Cloud. France email: b.raverdy@alamaison.fr phone: 01.41.12.20.27