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: Building DLL


Hi all,

I've been trying the suggestions mentioned on this list:

1. Create an import library
echo EXPORTS > foo.def
nm foo.exe | grep ' T _' | sed 's/.* T _//' >> foo.def
dlltool --def foo.def --dllname foo.exe --output-lib foo.a

I couldn't get this to work. In the executable I am trying to load the
library using g_module_open (from glib2.0), which fails no matter what I
specify for the library name.

2. use __attribute__ ((__dllexport__)) / __attribute__ ((__dllimport__))

compiled with:
> gcc -shared -o my_dll.dll dll.def dll.c
> gcc -o my_exe.exe exe.c  my_dll.dll

Following the suggestions from Danny Smith, I *do* manage to get this
working. However, I'm a little hazy about how to use this method within 
XFCE.

The above compile command creates a my_dll.dll, and g_module_open
manages to open this library. However, XFCE uses libtool for
compiling/linking, and this creates a 'cygmy_dll.dll' in addition to
libmy_dll.dll.a and libmy_dll.la.

In short, I'm not sure how I can integrate this method with all the
automake/libtool stuff.

Does anybody have an example of how to use this method together with
automake/libtool?

Kind regards,

Maarten


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