public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* exporting DLLs
@ 1999-06-21  3:07 Alan Patterson
  1999-06-21 11:20 ` Mumit Khan
  1999-06-30 22:10 ` exporting DLLs Alan Patterson
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Patterson @ 1999-06-21  3:07 UTC (permalink / raw)
  To: cygwin

Hi All,
    I am not completely clear on making DLLs. I have read the userguide
but am not sure on one point. The user guide discusses creating DLLs for
use within a cygwin program. Will these DLLs also work for other
compilers.

Specifically, can a MS Visual C++ program, or Apple WebObjects, program
utilise a DLL created using cygwin ? It does not need to have unix
system calls in it. I just want to use GNU dev. tools to create some
DLLs that others can use.

Any help, greatly appreciated.
Thanks in advance,
    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] 6+ messages in thread

* Re: exporting DLLs
  1999-06-21  3:07 exporting DLLs Alan Patterson
@ 1999-06-21 11:20 ` Mumit Khan
  1999-06-30 22:10   ` Mumit Khan
  1999-07-06  8:14   ` Thanks: Solved: DLLs Alexander Mader
  1999-06-30 22:10 ` exporting DLLs Alan Patterson
  1 sibling, 2 replies; 6+ messages in thread
From: Mumit Khan @ 1999-06-21 11:20 UTC (permalink / raw)
  To: Alan Patterson; +Cc: cygwin

On Mon, 21 Jun 1999, Alan Patterson wrote:

> Hi All,
>     I am not completely clear on making DLLs. I have read the userguide
> but am not sure on one point. The user guide discusses creating DLLs for
> use within a cygwin program. Will these DLLs also work for other
> compilers.

See http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ for info
on making DLLs. There are two entries you should look at:

  "How to make DLLs ..." -- for and by Cygwin applications.
  "How to make JNI ..."  -- shows how to make Cygwin DLLs that will be
  loaded by "foreign" applications such as MSVC execs/dlls.

Regards,
Mumit




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

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

* Re: exporting DLLs
  1999-06-21 11:20 ` Mumit Khan
@ 1999-06-30 22:10   ` Mumit Khan
  1999-07-06  8:14   ` Thanks: Solved: DLLs Alexander Mader
  1 sibling, 0 replies; 6+ messages in thread
From: Mumit Khan @ 1999-06-30 22:10 UTC (permalink / raw)
  To: Alan Patterson; +Cc: cygwin

On Mon, 21 Jun 1999, Alan Patterson wrote:

> Hi All,
>     I am not completely clear on making DLLs. I have read the userguide
> but am not sure on one point. The user guide discusses creating DLLs for
> use within a cygwin program. Will these DLLs also work for other
> compilers.

See http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ for info
on making DLLs. There are two entries you should look at:

  "How to make DLLs ..." -- for and by Cygwin applications.
  "How to make JNI ..."  -- shows how to make Cygwin DLLs that will be
  loaded by "foreign" applications such as MSVC execs/dlls.

Regards,
Mumit




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

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

* exporting DLLs
  1999-06-21  3:07 exporting DLLs Alan Patterson
  1999-06-21 11:20 ` Mumit Khan
@ 1999-06-30 22:10 ` Alan Patterson
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Patterson @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

Hi All,
    I am not completely clear on making DLLs. I have read the userguide
but am not sure on one point. The user guide discusses creating DLLs for
use within a cygwin program. Will these DLLs also work for other
compilers.

Specifically, can a MS Visual C++ program, or Apple WebObjects, program
utilise a DLL created using cygwin ? It does not need to have unix
system calls in it. I just want to use GNU dev. tools to create some
DLLs that others can use.

Any help, greatly appreciated.
Thanks in advance,
    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] 6+ messages in thread

* Thanks: Solved: DLLs
  1999-06-21 11:20 ` Mumit Khan
  1999-06-30 22:10   ` Mumit Khan
@ 1999-07-06  8:14   ` Alexander Mader
  1999-07-31 18:34     ` Alexander Mader
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Mader @ 1999-07-06  8:14 UTC (permalink / raw)
  To: Pontus Lidman; +Cc: cygwin, klaus

Hallo,

some days ago Pontus Lidman answered an email regarding
DLLs. Following the hints given in this answer and elsewhere in the
thread "variation on the .dll, .lib, .a theme (help!)" I was able to
solve the following problem:

	Given an MS built application build a DLL loadable by this
	application using GNU tools.
	In this DLL call functions provided by the original
	application in a DLL built using MS tools.

In other words the task was to build a DLL with a MS entry point, the
suitable calling convention, and resolved symbols from the
application's MS DLL.

Following Pontus' hint I declared my funtions for export as
__declspec(dllexport). This was not neccessary in MSVC -- something
somewhere must be fixing this. So the declaration reads something like

	  extern __declspec(dllexport)
	  foo( < params > )
	  { 
	    < body >
	  }

Following the hints of Takayuki Tamura I prepared the application's MS
DLLs to be linkable for my purposes. I produced an export definitions
file from the according .lib and used this with dlltool to get a .a
library. So for a pair MSNAME.LIB, MSNAME.DLL I had something like

	 echo "EXPORTS" > msname.def
	 nm --demangle --defined-only MSNAME.lib 
	 |sed -n 's/^.* T //p' >> .def
	 dlltool --dllname MSNAME.DLL --def msname.def \
	 --output-lib libmsname.a

Now I could take the Makefile.nocyg from the example "How to make JNI
..." provided by Mumit Khan at 
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
added the appropiate -L<mylibdir> and -lmsname and got a working DLL.

Thank you very much.

Alexander.
-- 
Alexander Mader <mader@kapp-coburg.de>

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

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

* Thanks: Solved: DLLs
  1999-07-06  8:14   ` Thanks: Solved: DLLs Alexander Mader
@ 1999-07-31 18:34     ` Alexander Mader
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Mader @ 1999-07-31 18:34 UTC (permalink / raw)
  To: Pontus Lidman; +Cc: cygwin, klaus

Hallo,

some days ago Pontus Lidman answered an email regarding
DLLs. Following the hints given in this answer and elsewhere in the
thread "variation on the .dll, .lib, .a theme (help!)" I was able to
solve the following problem:

	Given an MS built application build a DLL loadable by this
	application using GNU tools.
	In this DLL call functions provided by the original
	application in a DLL built using MS tools.

In other words the task was to build a DLL with a MS entry point, the
suitable calling convention, and resolved symbols from the
application's MS DLL.

Following Pontus' hint I declared my funtions for export as
__declspec(dllexport). This was not neccessary in MSVC -- something
somewhere must be fixing this. So the declaration reads something like

	  extern __declspec(dllexport)
	  foo( < params > )
	  { 
	    < body >
	  }

Following the hints of Takayuki Tamura I prepared the application's MS
DLLs to be linkable for my purposes. I produced an export definitions
file from the according .lib and used this with dlltool to get a .a
library. So for a pair MSNAME.LIB, MSNAME.DLL I had something like

	 echo "EXPORTS" > msname.def
	 nm --demangle --defined-only MSNAME.lib 
	 |sed -n 's/^.* T //p' >> .def
	 dlltool --dllname MSNAME.DLL --def msname.def \
	 --output-lib libmsname.a

Now I could take the Makefile.nocyg from the example "How to make JNI
..." provided by Mumit Khan at 
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
added the appropiate -L<mylibdir> and -lmsname and got a working DLL.

Thank you very much.

Alexander.
-- 
Alexander Mader <mader@kapp-coburg.de>

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

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

end of thread, other threads:[~1999-07-31 18:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-21  3:07 exporting DLLs Alan Patterson
1999-06-21 11:20 ` Mumit Khan
1999-06-30 22:10   ` Mumit Khan
1999-07-06  8:14   ` Thanks: Solved: DLLs Alexander Mader
1999-07-31 18:34     ` Alexander Mader
1999-06-30 22:10 ` exporting DLLs Alan Patterson

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