From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: Creation of dynamic object 7 Nov 1998 13:31:53 -0800 Message-ID: <9811070434.AA10400.cygnus.gnu-win32@modi.xraylith.wisc.edu> References: <3641B49C DOT EF2B1045 AT uz DOT kuleuven DOT ac DOT be> To: Jorrit Tyberghein Cc: gnu-win32 AT cygnus DOT com Jorrit Tyberghein 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 AT cygnus DOT com" with one line of text: "help".