From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34836 invoked by alias); 6 Mar 2016 22:27:19 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 34815 invoked by uid 89); 6 Mar 2016 22:27:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.2 spammy=H*MI:zimbra, H*x:Win, H*MI:JavaMail, Best X-HELO: smtp-o-1.desy.de Received: from smtp-o-1.desy.de (HELO smtp-o-1.desy.de) (131.169.56.154) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 06 Mar 2016 22:27:17 +0000 X-Clacks-Overhead: GNU Terry Pratchett Received: from smtp-map-1.desy.de (smtp-map-1.desy.de [131.169.56.66]) by smtp-o-1.desy.de (DESY-O-1) with ESMTP id 1299B2802FF for ; Sun, 6 Mar 2016 23:27:14 +0100 (CET) Received: from ZITSWEEP1.win.desy.de (zitsweep1.win.desy.de [131.169.97.95]) by smtp-map-1.desy.de (DESY_MAP_1) with ESMTP id 0794C13EA4 for ; Sun, 6 Mar 2016 23:27:13 +0100 (MET) Received: from smtp-intra-1.desy.de (lb-40-26.desy.de) by ZITSWEEP1.win.desy.de (Clearswift SMTPRS 5.5.0) with ESMTP id for ; Sun, 6 Mar 2016 23:27:14 +0100 Received: from z-mbx-3.desy.de (z-mbx-3.desy.de [131.169.55.141]) by smtp-intra-1.desy.de (DESY-INTRA-1) with ESMTP id AF6BF3E901 for ; Sun, 6 Mar 2016 23:27:13 +0100 (MET) Date: Sun, 06 Mar 2016 22:27:00 -0000 From: "Azatyan, Anushavan" To: cygwin@cygwin.com Message-ID: <1129585202.10528386.1457303233509.JavaMail.zimbra@desy.de> Subject: library compilation undefined reference to extern function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-03/txt/msg00059.txt.bz2 Hi, I am compiling a huge library, which is written and compiled under Ubuntu, I have fixed some problems to get it compiled in cygwin. The main() function is inside library. I stopped in some point which goes different in cygwin. I have some functions which are declared as - extern void func(void); Linker gives error - undefined reference to `func()' then I tried with this to compare differences.. #include using namespace std; extern void foo(void); int main() { cout<<" Print "; foo(); return 0; } a very simple example I can compile in linux (Ubuntu) without any problem, but in cygwin it goes with linker errors - undefined reference, in both systems I use $ gcc -c -Wall -fpic filename.cc $ gcc -shared -o libfoo.so filename.o commands. I could not find solution of this anywhere. Thank you, Best regards, Anushavan -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple