This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link gcc3.2 20020927 libgcc.a undefined ref to FindAtomA, AddAtomA, GetAtomNameA


I found this reference to the same problem as it relates to the cygwin DLL.
The -lkernel32 described as the solution didn't solve the problem for me.
Also, I attemped to compile the code with -mno-cygwin, and that
seems to present the same problem, even though I link with kernel32 also.

Does anyone have any other suggestions?
http://sources.redhat.com/ml/cygwin/2002-08/msg01385.html
Thanks!


"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


                                                                                                                  
                      Fred                                                                                        
                      Kulack/Rochester/        To:       cygwin at cygwin dot com                                        
                      IBM at IBMUS                cc:                                                                
                      Sent by:                 Subject:  Link gcc3.2 20020927 libgcc.a undefined ref to           
                      cygwin-owner at cygw         FindAtomA, AddAtomA, GetAtomNameA                                 
                      in.com                                                                                      
                                                                                                                  
                                                                                                                  
                      03/17/2003 10:06                                                                            
                      AM                                                                                          
                                                                                                                  
                                                                                                                  





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/







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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]