public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* DLLs
@ 1999-06-23  9:03 Alan Patterson
  1999-06-30 22:10 ` DLLs Alan Patterson
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Patterson @ 1999-06-23  9:03 UTC (permalink / raw)
  To: cygwin

Hi All,
     I am still in the process of getting my ecgs compiled DLL to work
with MSVC++. I'm still at the start of this process. My first question
is: How do I create a compatible .lib file to link into my MSVC app ?

Next, will the calling convention of the DLL's be the same (compatible)
?

All help greatly appreciated,
Many thanks,
    Alan

--
Alan Patterson            Algorithm Software Engineer
Nexan Telemed Ltd.,       +44 1223 713500
The Quorum, Barnwell Rd,  +44 1223 713501 (fax)
Cambridge CB5 8RE.        alan.patterson@nexan.com



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* DLLs
  1999-06-23  9:03 DLLs Alan Patterson
@ 1999-06-30 22:10 ` Alan Patterson
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Patterson @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

Hi All,
     I am still in the process of getting my ecgs compiled DLL to work
with MSVC++. I'm still at the start of this process. My first question
is: How do I create a compatible .lib file to link into my MSVC app ?

Next, will the calling convention of the DLL's be the same (compatible)
?

All help greatly appreciated,
Many thanks,
    Alan

--
Alan Patterson            Algorithm Software Engineer
Nexan Telemed Ltd.,       +44 1223 713500
The Quorum, Barnwell Rd,  +44 1223 713501 (fax)
Cambridge CB5 8RE.        alan.patterson@nexan.com



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Re: DLLs
  2002-06-20  9:47 DLLs Scott A. Smith
@ 2002-06-20 14:34 ` Charles Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Charles Wilson @ 2002-06-20 14:34 UTC (permalink / raw)
  To: Scott A. Smith; +Cc: cygwin

Sigh.  One of these days I really need to rewrite that docu.  I'll get 
to it.  Eventually...

Scott A. Smith wrote:


> 
>  1.) Is creation of a DLL using just gcc the preferred method now? 


Yes.

> It is
>      certainly quite easy to use, but is this documented anywhere? 


sort of.  'info gcc', 'info ld', but you have to know where to look or 
you won't find it. :-(

> It seems
>      to automatically put in its own DLL entry point function as well?


Yes.


>  2.) If trying to make a DLL with multiple commands, should one never use ld
>      for linking (as I read on this list somewhere), but stick with gcc,
> such
>      as in the example above?


Yes.  Otherwise things get *really* complicated.  To get an idea of what 
gcc does for you, look at /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs


>  3.) Is dllwrap supposed to just engulf the first 5 lines of the above
> example?


Dllwrap predates the inclusion of (most of) its code into ld.exe itself. 
   So it is *very* old -- I've been doing this for years now, and I have 
*never* directly invoked dllwrap when building a dll. (I believe 
libtool-1.4.2 invokes dllwrap, but that's an indirect usage. :-)


>  4.) Using this multiple command method, is there a way to get dlltool or
> dllwrap
>      to automatically build a .DEF file so that one need not explictly  use
> nm on
>      the object files prior to these commands?


Dunno.


>  5.) Is dlltool and dllwrap to become obsolete? 


IMO, they already are.

> Are there man pages for
> dllwrap?


No, I don't think so.  I think Mumit Khan's old gcc-cygwin site had the 
most information about dllwrap.

 
> My questions partially stem from a attempt to use the Dev-C++ IDE to manage
> the build.


AAAAAAAAAAGGGGGGGGHHHHHHHH! pant pant pant

I'm okay now.

But Dev-C++ IDE is way offtopic for this list.

>   6.) Anyone know why it is producing the undefined reference errors?


Probably because you're mixing dlls and import libs produced by 
different compilers/linkers.  But that's just a guess.

--Chuck



--
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] 5+ messages in thread

* DLLs
@ 2002-06-20  9:47 Scott A. Smith
  2002-06-20 14:34 ` DLLs Charles Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: Scott A. Smith @ 2002-06-20  9:47 UTC (permalink / raw)
  To: cygwin

Hello,

I've been having lots of fun trying to figure out how to build DLLs.
I should first mention that I have resisted putting declspec qualifiers
of any type into my volumes of code, so I have to use a .DEF file
to declare what is exported. From recent discussions on this list,
I guess that currently one can just invoke the compiler with a few
flags such as -shared and -Wl,--export-all-symbols to automatically
create a .DEF file (or at least the proper exports table) and build
a relocatable DLL that has the all the functions exported. I cannot find
this
documented anywhere, but I was able to copy a build of some other
software and it seems to work fine. Excellent. My makefile target looks
like

$(DLL_NAME) $(DLL_EXP_LIB): $(DLL_OBJS)
	g++ -shared -Wl,--out-implib=$(DLL_EXP_LIB) \
       -o $(DLL_NAME) $(DLL_OBJS) -Wl,--export-all-symbols $(DLL_LDLIBS)

Now, amidst the other scattered documentation on building DLLs there
are alternative methods mentioned. Some invoke dllwrap, dlltool, gcc
and/or ld, and they must use some repeat build commands to get a .DEF file,
.EXP file, .BASE file, and ultimately produce a relocatable DLL. It is
all quite confusing, and AFAIK, no documentation spells out exactly what
is happening in each of these steps. (Yes, I have looked at dllhelpers)
For example, the Cygwin Users Guide on Building and Using DLLs says to
do steps such as

gcc -s -Wl,--base-file,mydll.base -o mydll.dll mydll.o -Wl,-e,_mydll_init@12
dlltool --base-file mydll.base --def mydll.def --output-exp
mydll.exp --dllname mydll.dll
gcc -s -Wl,--base-file,mydll.base,mydll.exp -o mydll.dll
mydll.o -Wl,-e,_mydll_init@12
dlltool --base-file mydll.base --def mydll.def --output-exp
mydll.exp --dllname mydll.dll
gcc -Wl,mydll.exp -o mydll.dll mydll.o -Wl,-e,_mydll_init@12
dlltool --def mydll.def --dllname mydll.dll --output-lib mydll.a

I agree it is convoluted, and I vaguely understand why that had to be done.
As I recall, I had to make my .DEF file prior to this too, needed for
dlltool
(2nd command). Now for my questions.

 1.) Is creation of a DLL using just gcc the preferred method now? It is
     certainly quite easy to use, but is this documented anywhere? It seems
     to automatically put in its own DLL entry point function as well?
 2.) If trying to make a DLL with multiple commands, should one never use ld
     for linking (as I read on this list somewhere), but stick with gcc,
such
     as in the example above?
 3.) Is dllwrap supposed to just engulf the first 5 lines of the above
example?
 4.) Using this multiple command method, is there a way to get dlltool or
dllwrap
     to automatically build a .DEF file so that one need not explictly  use
nm on
     the object files prior to these commands?
 5.) Is dlltool and dllwrap to become obsolete? Are there man pages for
dllwrap?

My questions partially stem from a attempt to use the Dev-C++ IDE to manage
the build.
It automatically uses dllwrap, e.g. a target that looks like

$(DLL_NAME): $(DLL_OBJS)
	$(DLLWRAP) --export-all --output-def $(DEFFILE) --driver-name c++ \
       --implib $(DLL_EXP_LIB) $(DLL_OBJS) -o $(DLL_NAME) $(LIBS)

The resulting DLL causes linker errors complaining about undefined
references
to libBasics_a_iname and _nm(int0_t *).  Here "Basics" comes from the name
of
the DLL made/used. The man pages for ld is the only place I've found which
mentions the suffix _iname and how any such names are not exported.

  6.) Anyone know why it is producing the undefined reference errors?

I've tried so many differnt flags to try to stop this, but nothing works.
I'd just stick with one gcc line to make the DLL were it not for dllwrap
being embedded in the IDE. It would be nice to know what the differences
are.

At least I been having fun, or so I keep telling myself.

Thanks,
Scott



--
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] 5+ messages in thread

* DLLs
@ 1998-10-27  6:20 Marko Hrastovec
  0 siblings, 0 replies; 5+ messages in thread
From: Marko Hrastovec @ 1998-10-27  6:20 UTC (permalink / raw)
  To: gnu-win32

Hello

I have a problem with DLLs. I have adjusted grep.exe to be in a DLL.
Now I have the following problem. If I call grep.dll it hangs. I
presume it hangs because grep.dll can't load cygwin.dll. grep.exe
load cygwin.dll fine. How can I persuade grep.dll to work.

Thanks for answers, Marko

-- 
Marko Hrastovec
HAL interactive d.o.o. (multimedijska produkcijska hisa)
tel. & fax: +386 61 811 006
e-mail: marko.hrastovec@hal.si
URL: http://www.hal.si
--
Ker bi se vam verjetno prileglo nekaj oddiha vas
vabimo, da obiscete Turisticnega polza na naslovu:
http://www.turist.hal.si
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~2002-06-20 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-23  9:03 DLLs Alan Patterson
1999-06-30 22:10 ` DLLs Alan Patterson
  -- strict thread matches above, loose matches on Subject: below --
2002-06-20  9:47 DLLs Scott A. Smith
2002-06-20 14:34 ` DLLs Charles Wilson
1998-10-27  6:20 DLLs Marko Hrastovec

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).