public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: "Best" way to build a DLL?
@ 2002-02-11  8:24 Gerald S. Williams
  2002-02-11 10:44 ` Gerald S. Williams
  2002-02-11 10:51 ` Charles Wilson
  0 siblings, 2 replies; 9+ messages in thread
From: Gerald S. Williams @ 2002-02-11  8:24 UTC (permalink / raw)
  To: cygwin

Have I just been lucky, or is building and linking of
DLLs now supported by GCC directly?

It looks like Nousiainen [am.nousiainen@pp.inet.fi] has
had the same experience, although Chuck Wilson's reply
(and the FAQs, etc.) seem to indicate that you need to
use libtool, rebase, and/or other tools. I seem to be
getting along fine like this, though:

  gcc -o bin/my.dll -shared obj/my.o
  gcc -o bin/my.exe obj/main.o bin/my.dll

I verified that this uses the library dynamically--the
DLL is required at runtime.

In fact, this is much nicer since I don't have to worry
about those pesky .def files. And for some libraries, I
avoid warnings that way. For example, when I link with
libpython2.2.dll.a, I get warnings such as:

  Warning: resolving __Py_NoneStruct by linking to \
  __imp___Py_NoneStruct (auto-import)
  Warning: resolving _PyInt_Type by linking to \
  __imp__PyInt_Type (auto-import)

I don't get these when linking to the dll directly. It
sounds like some entries are missing in whatever .def
file is used to build that import library, but that is
just a guess.

I don't mind using tools where needed (e.g., if I want
to prevent some non-static symbols from being exported),
but I'd rather not use extra tools if I don't need them,
especially since some of the tools don't seem to be in
the normal Cygwin distributions. So for now my makefiles
just use GCC.

This has been working so far for me, but as I said it
could just be luck. Do I need to bite the bullet and
figure out how to make a DLL another way?

-Jerry

-O Gerald S. Williams, 22Y-103GA : mailto:gsw@agere.com O-
-O AGERE SYSTEMS, 555 UNION BLVD : office:610-712-8661  O-
-O ALLENTOWN, PA, USA 18109-3286 : mobile:908-672-7592  O-


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

^ permalink raw reply	[flat|nested] 9+ messages in thread
* "Best" way to build a DLL?
@ 2002-02-09 12:55 Nousiainen
  2002-02-10 18:34 ` Charles Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Nousiainen @ 2002-02-09 12:55 UTC (permalink / raw)
  To: cygwin

This seems to be the most complicated thing .. building a DLL file.
So, what is the best and recommended way to do the job using recent cygwin tools?

I've read autobook (http://sources.redhat.com/autobook/autobook/autobook_toc.html) and it gives some good advice (I'm using autotools in my project), though there are some problems 
I've encountered. It recommends using _LTLIBRARIES and libtool to build DLL, and as far as I know the building process of a DLL file is already integrated in gcc and ld, so is the document 
outdated? (I have to use both C and C++ code in my project, and when specifying AC_PROG_CXX in configure.in file the configure script doesn't succeed, because it tries to execute a file 
called ltconfig which doesn't exist. I really don't have a clue what to do here...)
Dllhelpers (http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/index.html) show another, simple way (using the new dll features of ld) to build the file and it is the only way I have 
managed to build a working DLL. However, I don't have an idea how to get this working smoothly with autotools.

So, what should I do? I'd appreciate if someone gave me an example of the configuration files for autotools (Makefile.am and configure.in).




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

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

end of thread, other threads:[~2002-02-15 21:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-11  8:24 "Best" way to build a DLL? Gerald S. Williams
2002-02-11 10:44 ` Gerald S. Williams
2002-02-11 10:53   ` Charles Wilson
2002-02-11 10:51 ` Charles Wilson
2002-02-15 12:27   ` Jason Tishler
2002-02-15 12:52     ` Gerald S. Williams
2002-02-15 13:06       ` Jason Tishler
  -- strict thread matches above, loose matches on Subject: below --
2002-02-09 12:55 Nousiainen
2002-02-10 18:34 ` Charles 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).