BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

using Mingw/cygwin static libs

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Rory Walsh
Guest





PostPosted: Fri Dec 09, 2005 4:08 pm    Post subject: using Mingw/cygwin static libs Reply with quote



Can anyone tell me if it is possible to link to a static lib file built
with a mingw/cygwin compiler in Borland C++ Builder?

Rory.
Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Dec 09, 2005 4:21 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote



Rory Walsh wrote:

Quote:
Can anyone tell me if it is possible to link to a static lib file
built with a mingw/cygwin compiler in Borland C++ Builder?

In lieu of a more authoritive answer I'll say that it's unlikely. LIBs
are usually proprietary so unless the compiler vendor has specifically
set out to support a competitor's linker there's not much chance they
will work.

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Rory Walsh
Guest





PostPosted: Fri Dec 09, 2005 4:26 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote




Quote:
In lieu of a more authoritive answer I'll say that it's unlikely. LIBs
are usually proprietary so unless the compiler vendor has specifically
set out to support a competitor's linker there's not much chance they
will work.

Cheers. The library itself is open source so I can just try to rebuild
in in C++ Builder. It's going to be a lot of work however. Are there any
conversion utilises that you know of that may help? if this seems like a
ridiculous suggestion but is there any way I can use the MinGW make file
by replacing g++ with a call to the Borland compile? Thanks again,
Rory.

Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Dec 09, 2005 4:40 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote

Rory Walsh wrote:

Quote:
Cheers. The library itself is open source so I can just try to
rebuild in in C++ Builder. It's going to be a lot of work however.

Maybe, maybe not. Depends on the source code and relative compliance of
the two compilers.

Quote:
Are there any conversion utilises that you know of that may help?

Why not convert the LIB into a DLL (usually a trivial process) and then
use that DLL from your Builder code?
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Dec 09, 2005 4:50 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote

Andrue Cope [TeamB] wrote:

Quote:
(usually a trivial process)

I should clarify that. It's trivial in terms of mental effort but can
involve a lot of typing :)

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Rory Walsh
Guest





PostPosted: Fri Dec 09, 2005 5:01 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote

Andrue Cope [TeamB] wrote:
Quote:
Rory Walsh wrote:


Cheers. The library itself is open source so I can just try to
rebuild in in C++ Builder. It's going to be a lot of work however.


Maybe, maybe not. Depends on the source code and relative compliance of
the two compilers.


Are there any conversion utilises that you know of that may help?


Why not convert the LIB into a DLL (usually a trivial process) and then
use that DLL from your Builder code?
Great so a MinGW/Cygwin compiled dll will work without problems? I ask

because I know there are issues with MSVC compiled dll's.
Rory.

Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Dec 09, 2005 5:24 pm    Post subject: Re: using Mingw/cygwin static libs Reply with quote

Rory Walsh wrote:

Quote:
Great so a MinGW/Cygwin compiled dll will work without problems?

As long as the DLL author doesn't export anything 'complicated'.

Quote:
I ask because I know there are issues with MSVC compiled dll's.

Not especially. The only problems arise when the author exports C++
specific data.

This is true of every DLL ever written regardless of the tool and even
language used to create it. 1If you stick to exporting what is commonly
known as POD (Plain Old Data) then pretty much everyone knows how to
import it. After all every compiler agrees on what a '32-bit signed
integer is' and if you export a pointer to an array of 8-bit characters
it's a pretty weird development environment that doesn't have some way
of importing that.

Where you can come unstuck is when you export language specific stuff.
Exporting a C++ class means that you are exporting something that
probably only another C++ derived executable can import. And that's if
you're lucky. Unfortunately different C++ vendors have no reason to
export classes in the same way and MS and Borland chose a different
route.

Luckily it isn't ever neccessary to export anything clever. Although
you can't export a class directly you can export a collection of
functions that each take a handle as an argument and then the DLL uses
that handle to decide which instantiated object to call.

To put this another way. BCB code can import anything from an MSVC DLL
that is represented in a way it expects. This means any built-in type
except perhaps for floating point numbers (and that's an assumption by
me). It includes pointers to those types. It includes functions as long
as the return type is a built-in type.

One gotcha is that DLLs are often shipped with a stub LIB that takes
care of loading the DLL and providing the functions to the client. You
will have to generate a Borland specific LIB if you want to use this
method of loading DLLs. Luckily Borland provide IMPLIB and it seems to
do its job quite well. Personally I prefer to manually load my DLLs Smile
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.