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 Subject: Link gcc3.2 20020927 libgcc.a undefined ref to FindAtomA, AddAtomA, GetAtomNameA To: cygwin AT cygwin DOT com Message-ID: From: Fred Kulack Date: Mon, 17 Mar 2003 10:06:19 -0600 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii I tried to keep this brief but still complete. I'm using gcc to compile C++ code using ODBC and some proprietary APIs (iSeries client access). During link, libgcc is not finding references to FindAtomA(), AddAtomA(), GetAtomNameA() and GetModuleHandleA() (exact error follows). I suspect a luser error on my part, but I'm wondering if someone can kick me in the right direction? Thanks for any pointers. I've googled the archives and don't find anything related. I've looked at the FAQ and UsersGuide. I've tried adding -lgcc and -lkernel32 to the link options, hoping there was some ordering issue with kernel32. I've tried statically linking hoping to pull in only those modules that I require and perhaps miss the ones that refer to the undefined references. In the link statement below, the -lqxdaedrs,-lodbc32 and -lcwbodbc are DLL files using the support described in "pinfo ld" for direct linking to a DLL. Also, doesn't seem related, but I'm perhaps mistaken, there's also some QUACKERY of some sort going on in the header files that I use for compiling to the target APIs. They claim to support the GNU compiler and have a section which (re)defines __stdcall to be empty. However, when I remove the extra #define for __stdcall, I lose the ability to link to the ODBC functions, and I think I've done that right for that otherwise. ============== INFO ON GCC VERSION ============== > gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs Configured with: /netrel/src/gcc-3.2-3/configure --enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posi x --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-ve rsion-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --enable -haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecd ir=/usr/sbin Thread model: posix gcc version 3.2 20020927 (prerelease) ============== LINK ============== g++ -g -mthreads -Wno-deprecated -I. -I/CAToolkit/Include clivsxda.o utility.o xdamod.o \ climod.o statements.o system.o -L/WINNT/system32 -lqxdaedrs -lodbc32 -lcwbodbc -lgcc -lkernel32 \ -o clivsxda.exe /usr/lib/gcc-lib/i686-pc-cygwin/3.2/libgcc.a(w32-shared-ptr.o)(.text+0x60): undefined reference to `_FindAtomA AT 4' /usr/lib/gcc-lib/i686-pc-cygwin/3.2/libgcc.a(w32-shared-ptr.o) (.text+0x131): undefined reference to `_AddAtomA AT 4' /usr/lib/gcc-lib/i686-pc-cygwin/3.2/libgcc.a(w32-shared-ptr.o) (.text+0x18e): undefined reference to `_GetAtomNameA AT 12' /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a (_cygwin_crt0_common.o)(.text+0xbd): undefined reference to `_Ge tModuleHandleA AT 4' collect2: ld returned 1 exit status ============= QUACKERY WITH __stdcall definition ============= #if defined( __GNUC__ ) #define _Export #define CwbExport #define CwbImport #define __stdcall #define _System #define _RTLENTRY #define _Cdecl #define _Far16 #define _Pascal #define _Seg16 #define SEG16PTR #endif /* __GNUC__ */ ============ RESULT OF QUACKERY ============ g++ -g -mthreads -Wno-deprecated -I. -I/CAToolkit/Include -c system.C In file included from /CAToolkit/Include/cwb.h:33, from /CAToolkit/Include/qxdaedrsnt.h:71, from system.h:28, from system.C:1: /CAToolkit/Include/cwbport.h:329:1: warning: "__stdcall" redefined system.C:1:1: warning: this is the location of the previous definition "The stuff we call "software" is not like anything that human society is used to thinking about. Software is something like a machine, and something like mathematics, and something like language, and something like thought, and art, and information... but software is not in fact any of those other things." Bruce Sterling - The Hacker Crackdown Fred A. Kulack - IBM eServer iSeries - Enterprise Application Solutions ERP, Java DB2 access, Jdbc, JTA, etc... IBM in Rochester, MN (Phone: 507.253.5982 T/L 553-5982) mailto:kulack AT us DOT ibm DOT com Personal: mailto:kulack AT magnaspeed DOT net AIM Home:FKulack AIM Work:FKulackWrk MSN Work: fakulack AT hotmail DOT com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/