From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18763 invoked by alias); 29 Sep 2011 12:28:42 -0000 Received: (qmail 18754 invoked by uid 22791); 29 Sep 2011 12:28:41 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from posta.videotec.com (HELO videotec.com) (80.86.155.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Sep 2011 12:28:27 +0000 Received: by postavm.sede.videotec.com (Postfix, from userid 503) id 4E9C6138AED; Thu, 29 Sep 2011 14:28:26 +0200 (CEST) Received: from [192.168.103.53] (unknown [192.168.68.130]) by postavm.sede.videotec.com (Postfix) with ESMTP id C830D138ADD for ; Thu, 29 Sep 2011 12:28:24 +0000 (UTC) Message-ID: <4E846468.5080009@videotec.com> Date: Thu, 29 Sep 2011 13:32:00 -0000 From: Ottavio Campana User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110818 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: weird problem with c++ libraries and symbols Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2011-09/txt/msg00237.txt.bz2 Hi! I am facing a weird problem with a c++ library and after having googled for a while I'm asking here for a suggestion. In the last months, I developed an application in C. This application consists of several libraries and programs. Everything is written in C with the exception of the library handling RTSP streaming, which uses livemedia ( http://www.live555.com/liveMedia/ ) to do all the protocol stuff, which is written in C++, but the RTSP library I wrote was meant to be used only by C programs. LiveMedia provides some makefiles that compile the 4 provided libraries as static libraries, and I statically linked these .a files into my final .so and everything worked. Now I have to expand my application and I need to use the libraries provided by livemedia also in another program, so I decided to try and write my own makefile by using autotools to get four .so libraries that I can reuse them in different applications. I build the for libraries of livemedia and my own library which depends on the previous four and I expect that by linking all the libraries to the binary everything should work, but it does not. The problem that I'm facing is that some symbols from the livemedia libraries are undefined, I tried to solve it in different ways but I ran out of ideas. Here are my thoughts: * can it be the fact that I'm mixing C and C++? It seems that the unresolved symbols are due to virtual and static functions and not to name mangling * I tried to add all the files of the livemedia library to the sources of my dynamic library, so that I could have one big library instead of 5, but the problem persists. * I complied again manually the static libraries and added them to my dynamic library. It works, but I don't understand why and I cannot understand why the previous case does not. Is it a problem due to autotools? * I tried to use -fvisibility with different values, with no luck. I'm not expert of C++, so surely I made a mistake, but I haven't been able to understand where it is. Did you ever face a similar problem? Or do you have a hint for me? I wrong this long email trying to clearly explain my problem. Thank you for any answer in advance, Ottavio