This is the mail archive of the cygwin@sourceware.cygnus.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]

Re: Linking with .LIB files


David W Palmer wrote:
> 
> Text item:
> 
> 
>      Okay, I've pulled together the feedback and made a few more attempts.
> 
>      I compile the program using:
>         gcc -o simple.c
> 
>      and link using:
> 
>      link simple.o libc.a libcygwin.a libkernel32.a libuser32.a glu32.lib
>      opengl32.lib libgdi32.a /subsystem:windows /machine:i386
>      /entry:mainCRTStartup
> 
>      The output:
> 
> //f/pgming/opengl/simple$ make
> link simple.o libc.a libcygwin.a libkernel32.a libuser32.a glu32.lib opengl32.li
> b libgdi32.a /subsystem:windows /machine:i386 /entry:mainCRTStartup
> Microsoft (R) 32-Bit Incremental Linker Version 5.00.7022
> Copyright (C) Microsoft Corp 1992-1997. All rights reserved.
> 
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol ___CTOR_LIST
> __
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol ___DTOR_LIST
> __
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol __data_start
> __
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol __data_end__
> 
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol __bss_start_
> _
> libcygwin.a(libccrt0.o) : error LNK2001: unresolved external symbol __bss_end__
> simple.exe : fatal error LNK1120: 6 unresolved externals
> make: *** [simple.exe] Error 25
> //f/pgming/opengl/simple$
> 
>      I greped the contents of every .a I could find and there's no trace of a
>      __data_start__ tag anywhere.  I grep them by doing the following:

I believe (but have not verified) that ld generates these.
So, if link doesn't produce some equivalent that can be
massaged/converted
into what cygwin.dll is expecting (libccrt0.o just stashes them for use
later
by cygwin.dll) you may be out of luck.  However, the _start_ and _end_
symbols
are only used by fork, which you probably aren't using, and the LISTs
are C++
ConstrucTOR and DesstrucTOR lists, which you probably also don't need. 
So, try
just defining all these to null in the link command line or script file,
or
define them in simple.c, and see how that goes.  You need to strip one
'_' if
you define them in a .c file on a x86 box (but not on a PowerPC box).
i.e., add

void (*__CTOR_LIST__)(void) = 0;
void (*__CTOR_LIST__)(void) = 0;
char _data_start__, _data_end__, _bss_start__, _bss_end__;

to simple.c and fire 'er up.

--
<J Q B>
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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