public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Build libraries with gcc
@ 2001-02-12  7:21 Patrick Reuter
  2001-02-12  8:23 ` Charles S. Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Reuter @ 2001-02-12  7:21 UTC (permalink / raw)
  To: cygwin

Hello,

I have a question building libraries using gcc under cygwin.

When compiling in Linux/Unix, I have no error message. When compiling
under Windows, I get the following error message with any of my
libraries:

g++ -shared -pg -o libGIF.so main.o readGIF.o writeGif.o

Cannot export _bss_end__: symbol not defined
Cannot export _bss_start__: symbol not defined
Cannot export _data_end__: symbol not defined
Cannot export _data_start__: symbol not defined
Cannot export _monstartup: symbol not defined
main.o(.text+0x31):main.c: undefined reference to `_monstartup'
collect2: ld returned 1 exit status


Tank you for any help!!

Patrick




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Build libraries with gcc
  2001-02-12  7:21 Build libraries with gcc Patrick Reuter
@ 2001-02-12  8:23 ` Charles S. Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Charles S. Wilson @ 2001-02-12  8:23 UTC (permalink / raw)
  To: Patrick Reuter; +Cc: cygwin

g++ -shared doesn't do what you think.  It doesn't build unix-style
shared libraries.  It builds windows DLL's, which *MUST* end in .dll if
you want the windows loader to load them into memory for your linked
app.

If you want a static lib, leave out the -shared.

If you want a DLL, you probably need to do a mailing list search on
"building a DLL"; it is likely that you will need to modify the source
code (hint: __declspec(dllexport) and __declspec(dllimport)
decorations).  Take a look at the source code and Makefiles in the
ncurses-5.2-4-src.tar.gz packge (especially in the c++/ directory).

--Chuck

Patrick Reuter wrote:
> 
> Hello,
> 
> I have a question building libraries using gcc under cygwin.
> 
> When compiling in Linux/Unix, I have no error message. When compiling
> under Windows, I get the following error message with any of my
> libraries:
> 
> g++ -shared -pg -o libGIF.so main.o readGIF.o writeGif.o
> 
> Cannot export _bss_end__: symbol not defined
> Cannot export _bss_start__: symbol not defined
> Cannot export _data_end__: symbol not defined
> Cannot export _data_start__: symbol not defined
> Cannot export _monstartup: symbol not defined
> main.o(.text+0x31):main.c: undefined reference to `_monstartup'
> collect2: ld returned 1 exit status
> 
> Tank you for any help!!
> 
> Patrick
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-12  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-12  7:21 Build libraries with gcc Patrick Reuter
2001-02-12  8:23 ` Charles S. Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).