WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: How to create a relocatable dll with mingw

Re: How to create a relocatable dll with mingw

by Srinivas Cherukumilli :: Rate this Message:

| View in Thread

--- On Fri, 4/20/12, Earnie Boyd <earnie@...> wrote:

> From: Earnie Boyd <earnie@...>
> Subject: Re: [Mingw-users] How to create a relocatable dll with mingw
> To: "MinGW Users List" <mingw-users@...>
> Date: Friday, April 20, 2012, 5:16 AM
> On Thu, Apr 19, 2012 at 2:32 PM,
> Srinivas Cherukumilli <vasu_c@...>
> wrote:
> >
> >
> > --- On Thu, 4/19/12, Earnie Boyd <earnie@...>
> wrote:
> >
> >> From: Earnie Boyd <earnie@...>
> >> Subject: Re: [Mingw-users] How to create a
> relocatable dll with mingw
> >> To: "MinGW Users List" <mingw-users@...>
> >> Date: Thursday, April 19, 2012, 11:00 AM
> >> Do not top post.
> >>
> >> On Thu, Apr 19, 2012 at 1:45 PM, Srinivas
> Cherukumilli
> >> <vasu_c@...>
> >> wrote:
> >> >
> >> > Thanks for the response Earnie,
> >> >
> >> > But, unfortunatley it does not work.
> >> >
> >> > gcc complains about the missing '.a'
> >> > $ gcc -shared -o test1.dll test1.o
> --out-implib
> >> libtest1.dll.a
> >> > gcc.exe: libtest1.dll.a: No such file or
> directory
> >> >
> >>
> >> Sorry it should be -Wl,--out-implib,libtest1.dll.a
> since it
> >> is a linker option.
> >
> > Thanks again Earnie.
> > Sorry about top posting. Not used to sending mails to
> forums.
> > I still have issues with using the -Wl,relocatable and
> -shared options together.
> >
> > So, for the two commands you suggested:
> > (1) gcc -shared -o bar.dll bar.o
> -Wl,--out-implib,libbar.dll.a
> > (2) gcc -Wl,-relocatable -shared -o bar.dll bar.o
> -Wl,--out-implib,libbar.dll.a
> >
> > Step (1) works.  Get linker errors for step (2). I
> hope I got all the options right in step (2).
> >
>
> Oh, sorry for the confusion. (///)  --relocatable isn't
> usable with
> -shared.  You can use --embedded-relocs with -shared
> though.
>
Thanks Earnie,

This switch did not help either. I have attached a small test case where the program that loads up the dll's is compiled with Visual Studio 9.0 and the dll's are compiled using gcc-4.2.1-mingw32 and this has the MSVCR90.

I have left my executables etc. as-is in the attached tar file. One person on this mailing list already tried building and running this with gcc-4.5.x and seemed to work for him.

Would appreciate if anyone else could try and suggest a workaround/solution to this issue as upgrading to a newer gcc is not a viable option for us. I can attach my version of the mingw compiler as well if needed.

Thanks & Regards,
Vasu

> --
> Earnie
> -- https://sites.google.com/site/earnieboyd
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it
> FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> MinGW-users mailing list
> MinGW-users@...
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard
> for the list etiquette may cause your account to be
> moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe
> at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:mingw-users-request@...?subject=unsubscribe

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@...?subject=unsubscribe

testcase.tar.gz (53K) Download Attachment

 « Return to Thread: How to create a relocatable dll with mingw