X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:message-id:subject:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=JUs SpH8EsQLp9Uu1mvPhxVFVC+HLPwzgBY5y/nQyqMn1D7G1pEiu2TUc5SMg+LH0CgS c8VcJxK7HNKELTTkabTdmcXsFZ73e+D6hD6T7YaWhdVzD8fCTzXpVzjhIgB3sTyT XzEk5yLssNTYXSvq7ip/a39lX1B0bOVac4jm3WBI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:message-id:subject:mime-version :content-type:content-transfer-encoding; s=default; bh=c7R3DFgRE JGCQQiJ9khggGE7udo=; b=hLOpsoqm18r1yhZRjp8/rjTPdec8oATPEbv4OBsny Krua9h8fSyp5Jex8akJku8PysehQnVmO5UWVmE0l5AetBiTbPw/uZdh2AM90WNls P5gNUaMIwF1NyC9daSyaWGbkl/GHSk7p6I3xCzyqAL2u1VzcFaptzxShLcqiAu03 fo= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 X-Clacks-Overhead: GNU Terry Pratchett Date: Sun, 6 Mar 2016 23:27:13 +0100 (CET) From: "Azatyan, Anushavan" To: cygwin AT cygwin DOT 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 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