Quantcast

Need to compile visual studio 2005 compiled library in Mingw compiler

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need to compile visual studio 2005 compiled library in Mingw compiler

narayan_mingw
I have a visual studio 2005 compiled win32 dll and lib and i need to use this in c source that is to be compiled in mingw compiler to produce a binary exe.

Is it possible to do this ?

Please give me your suggestions ..
LRN
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need to compile visual studio 2005 compiled library in Mingw compiler

LRN
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13.09.2012 17:39, narayan_mingw wrote:
> I have a visual studio 2005 compiled win32 dll and lib and i need
> to use this in c source that is to be compiled in mingw compiler to
> produce a binary exe.
>
> Is it possible to do this ?
>
> Please give me your suggestions ..
1) Create a mingw-compatible import library that ld will link your
program to, and link to it. Like this:
$ dlltool --export-all-symbols foobar.dll -l libfoobar.dll.a
$ gcc -c mingwprogram.c -o compiledmingwprogram.exe
- -Ldirectory-where-libfoobar.dll.a-is -lfoobar

2) Or link to the dll file directly.
$ gcc -c mingwprogram.c -o compiledmingwprogram.exe foobar.dll


(1) is preferred, since it's easier to port.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQUgE1AAoJEOs4Jb6SI2Cw5XwIAMVSOtyeLvzRlbXd9+7cItBZ
6Dkk8sK2tlJi5RVETlxSyE8plCbGhrjJzknzd83SEtEkJ3Fg6PyunHdVL+q7q4L0
AuKBlHrbwPQXhkaKjhUvGeiVjBqL7YTw2Q9ZykTwgv56Ut5H2pWZyrXrJYIsn9Je
CbtBjWm9vm3CxTyiRPv9OBhltf9b7MnQaWVYl2Na5PpuEZBg3uvSYmphYB0SJrxA
tf55Jxl0QNOG2+dTn/Aw4Js28zjrBsZvr7eZEebgt5vXVDtWzcHT5RXrSCLtrLkf
A+zWSKg8zUaB5rjt23eKdsfGR1SwbE5H/7j1olw7uG90hRZNX6jUnXR8pfCYICg=
=KB9M
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
MinGW-users mailing list
[hidden email]

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:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need to compile visual studio 2005 compiled library in Mingw compiler

Earnie Boyd
On Thu, Sep 13, 2012 at 11:52 AM, LRN wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 13.09.2012 17:39, narayan_mingw wrote:
>> I have a visual studio 2005 compiled win32 dll and lib and i need
>> to use this in c source that is to be compiled in mingw compiler to
>> produce a binary exe.
>>
>> Is it possible to do this ?
>>
>> Please give me your suggestions ..
> 1) Create a mingw-compatible import library that ld will link your
> program to, and link to it. Like this:
> $ dlltool --export-all-symbols foobar.dll -l libfoobar.dll.a
> $ gcc -c mingwprogram.c -o compiledmingwprogram.exe
> - -Ldirectory-where-libfoobar.dll.a-is -lfoobar
>

This only works for a C library.

> 2) Or link to the dll file directly.
> $ gcc -c mingwprogram.c -o compiledmingwprogram.exe foobar.dll
>

And as well for this.

If you have a C++ library then you'll need to refer to the suggestions
at http://mingw.org/wiki/MixingCompilers to overcome your issues.

--
Earnie
-- https://sites.google.com/site/earnieboyd

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
MinGW-users mailing list
[hidden email]

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:[hidden email]?subject=unsubscribe
Loading...