delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/12/11:13:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A82DC03.7040800@gmail.com>
Date: Wed, 12 Aug 2009 17:13:07 +0200
From: Javier Sedano <javier DOT sedano AT gmail DOT com>
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Unable to link
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi friends,

	I've got a extrange problem compiling (linking, actually) under cygwin, 
maybe you can help me. The same procedure works prefectly on Linux, so I 
think I am probably not making some thing that is somehow needed on cygwin.

	I've got a set of .c files to be compiled and merger in a library. So 
far, so good. But, when I compile the test, it complains about missing 
functions. As you can see in the trace below, the function _testBP_1 is 
_not_ in the lib, but I am not using it!. Why is gcc (ld, actually) 
trying to find _testBP_1() when I was using testBP_1().
	As said, exactly the same code, the same Makefile and the same 
procedure works on Linux.

	I've also tried to use "libao-g.a" in the command line, instead of "-L. 
-lao-g", but it fails as well.

	Any idea?


jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> make libao-g.a
    [... Many lines removed]
ranlib libao-g.a
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> ls -l libao-g.a
-rw-r--r-- 1 jsedano Ninguno 198714 Aug 12 17:03 libao-g.a
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> gcc -o tests/testBypass 
-Wa,--defsym -Wa,DEBUG=1 -DDEBUG -g -gstabs+ -Wall testBypass.c -L. -lao-g
/cygdrive/c/WINDOWS/TEMP/ccCr93oV.o: In function `main':
/home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined 
reference to `_testBP_1'
/home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined 
reference to `___aoAsBypassCall'
    [... Many other "undefined references" removed]
collect2: ld returned 1 exit status
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep _testBP_1
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep testBP_1
00000166 T testBP_1
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> grep testBP_1 testBypass.c
void testBP_1();
     returned = __aoAsBypassCall(&testBP_1, // Function to call
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> gcc -o tests/testBypass 
-Wa,--defsym -Wa,DEBUG=1 -DDEBUG -g -gstabs+ -Wall testBypass.c libao.a
/cygdrive/c/WINDOWS/TEMP/ccbV5cCe.o: In function `main':
/home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined 
reference to `_testBP_1'
/home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined 
reference to `___aoAsBypassCall'
    [... Many other "undefined references" removed]
collect2: ld returned 1 exit status
jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO>




-- 
--
Javier Sedano
javier DOT sedano AT gmail DOT com

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019