This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: How to make DLLs in cygwin for MSVC and BCB


Patrick Rotsaert wrote:

> I need to build a DLL in cygwin (I use a lot of POSIX functions), that I
> can use in MSVC and Borland CBuilder apps.

http://cygwin.com/faq/faq.html#TOC102

Note that this just references loading cygwin1.dll and getting it
initialized.  If you have your own DLL that depends on cygwin1.dll you
will probably first have to load and initialize Cygwin, and then load
your own DLL.

You may still run into issues if you are trying to use both MSVCRT*.dll
and Cygwin in the same application.  They both implement a completely
separate and incompatible C runtime library, and it certainly won't work
if you try to include both at link-time.  You might get around the
issues if you load cygwin1.dll dynamically and do everything through
GetProcAddress, since that takes care of the problem of having duplicate
symbols for all the CRT functions.  In your example that would mean
calling GetProcAddress for the address of strcpy (and any other Cygwin
function you plan to use.)

And, as far as I know, using cygwin1.dll in this way means all your code
must be released under the GPL, or another OSI approved license.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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