This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Creation of dynamic object
- To: Jorrit Tyberghein <Jorrit dot Tyberghein at uz dot kuleuven dot ac dot be>
- Subject: Re: Creation of dynamic object
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Fri, 06 Nov 1998 22:34:07 -0600
- Cc: gnu-win32 at cygnus dot com
Jorrit Tyberghein <Jorrit.Tyberghein@uz.kuleuven.ac.be> writes:
>
> I'm using the new CygWin B20 and try to create a dynamic object (not a DLL)
> which I can access from another executable with dlopen and dlsym.
>
> On Unix I would create this (linking stage) with:
>
> g++ -Wl -shared -o dynobj.so obj_file1.o obj_file2.o obj_file3.o ... -l..
(1) Cygwin ld does not yet support the -shared flag.
(2) The correct form of passing flags to the linker is -Wl,-shared OR
-Xlinker -shared (my preference because it's more consistent and
leads to fewer surprise). Your case works only because GCC "knows"
how to pass the -shared option through.
>
> How can I fix this? Note that I DON'T want to make a DLL.
>
I honestly don't know the difference between a dynamic object and a DLL
in this case, so I'll just offer my simple example. Visit
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygb20/misc/
and grab dlopen-example.tar.gz. It's as easy as building on any Unix
system. When ld is rewritten to accept -shared option, you can just
replace "dllwrap" with "ld" in the Makefile.
There seems to be one gotcha that I found while porting our loadable
simulation modules -- I have to use .dll extension, rather than our
usual .so extension. Must be missing something simple.
What exactly is the difference between a dynamic object and DLL?
Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".