This is the mail archive of the
mailing list for the Cygwin project.
Opening a (cygwin-ised) DLL
- From: "John Emmas" <johne53 at tiscali dot co dot uk>
- To: <cygwin at cygwin dot com>
- Date: Mon, 24 Nov 2008 09:28:47 -0000
- Subject: Opening a (cygwin-ised) DLL
Suppose I'm building a Linux app under Cygwin and that app builds an
executable and a DLL. At run time, what would be the preferred method
for the executable to open the DLL under Cygwin - LoadLibrary() or
I'm assuming that dlopen() is better for portability - but given that the
DLL is (presumably) a pretty standard Windows DLL, is there possibly
an argument for using a preprocessor directive, like this ? - e.g.
#if defined(WIN32) || defined(__CYGWIN__)
#define LoadLib(name) LoadLibrary(name)
#define LoadLib(name) dlopen((name), RTLD_NOW)
Obviously, the same kind of directives would need to be applied when
unloading the library and getting symbol addresses etc.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html