X-Spam-Check-By: sourceware.org Message-ID: <2fb803240606010717r5aadc9afud2899ea77a53f02a@mail.gmail.com> Date: Thu, 1 Jun 2006 22:17:36 +0800 From: "Alvin Cao" To: cygwin AT cygwin DOT com Subject: elf2flt linkage error in cygwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 hi folks, I'm trying to build a toolchain in cygwin for uclinux. The program "elf2flt" links against both libcygwin and libiberty from arm-uclinux-elf-binutils. There are "getopt" implementations in both libs and I got the error message: ===============log========================== gcc -g -O2 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SY S_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_ UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BFD_H=1 -DHAVE_VPRINTF=1 -DTARGET_arm -I/cygdrive/d/cyghome/build_toolchain/arm-uclinux-elf-binu tils/bfd -I/cygdrive/d/cyghome/build_toolchain/binutils-2.16.1/include -o elf2flt.exe /cygdrive/d/cyghome/build_toolchain/elf2flt-20060601/elf2flt.c /cygdrive/d/cyghome/build_toolchain/elf2flt-20060601/stubs.c -lcygwin /cygdrive/d/cyghome/build_toolchain/arm-uclinux-elf-binutils/bfd/libbfd.a /cygdr ive/d/cyghome/build_toolchain/arm-uclinux-elf-binutils/libiberty/libiberty.a /cygdrive/d/cyghome/build_toolchain/arm-uclinux-elf-binutils/libiberty/libiberty.a(getopt.o): In function `getopt': /cygdrive/d/cyghome/build_toolchain/binutils-2.16.1/libiberty/getopt.c:977: multiple definition of `_getopt' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(d000932.o):: first defined here collect2: ld returned 1 exit status make: *** [elf2flt.exe] Error 1 ==============log============================ It seems libcygwin is linked prior to libiberty but it does not work. How can I link the correct lib? Any help is appreciated! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/