public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* .dll question
@ 2002-10-01 16:45 Paul G.
  0 siblings, 0 replies; 10+ messages in thread
From: Paul G. @ 2002-10-01 16:45 UTC (permalink / raw)
  To: cygwin

Hi folks,

	Try not to add to noise for this list unless it seems necessary for something I am 
currently porting.  That is my apology ahead of time.

	Does msvc/c++ load .dlls generated using gcc -shared  -mno-cygwin?

	I've not ever had msvc/c++ so can't say one way or the other.

	Thanks,

		Paul G.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2003-04-21  0:21     ` David Starks-Browning
@ 2003-04-21  2:20       ` Dan Kegel
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Kegel @ 2003-04-21  2:20 UTC (permalink / raw)
  To: David Starks-Browning; +Cc: cygwin

David Starks-Browning wrote:
>>>	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
>>>does Microsofts'  method of name mangling prohibit such things?
>>
>>No it can't. In general, C++ compilers don't interoperate. The C++-Lite
>>FAQ has a section on this.
>>
>>From memory, the issues are:
>>*name mangling
>>*VMT layout
>>*new[] management
>>*exception handling
>>
>>If you want to use cygwin C++ from MSVC, write some C bindings for the
>>code.
> 
> ... All the FAQ says about this is the following:
> 
>   Q.  Can I mix objects compiled with msvc++ and gcc?
> 
>   A.  Yes, but only if you are combining C object files. MSVC C++ uses
>       a different mangling scheme than GNU C++, so you will have
>       difficulties combining C++ objects.
> 
> I'd like to include the extra detail that Robert goes into, if it's
> correct.  Does anyone know for sure?

Any discussion of these issues isn't complete without mentioning
the fact that you can't even mix objects compiled by gcc2.x
and gcc3.x.  This was caused by the switchover as of gcc3.x to the standard
C++ ABI defined at http://www.codesourcery.com/cxx-abi/
That document defines very carefully all the issues Robert writes
about, I think.  All C++ compilers for Linux should now be following
that standard.  See also http://gcc.gnu.org/gcc-3.2/c++-abi.html

Also, I have some extra detail about name mangling in MSVC6 and gcc2.x
at http://www.kegel.com/mangle.html
It's three years old but may still be useful.

- Dan

-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02 16:19   ` Robert Collins
  2002-10-02 16:59     ` Paul G.
  2002-10-02 18:12     ` Shankar Unni
@ 2003-04-21  0:21     ` David Starks-Browning
  2003-04-21  2:20       ` Dan Kegel
  2 siblings, 1 reply; 10+ messages in thread
From: David Starks-Browning @ 2003-04-21  0:21 UTC (permalink / raw)
  To: cygwin

On  3 Oct 02, Robert Collins writes:
> On Thu, 2002-10-03 at 09:13, Paul G. wrote:
> 
> > 	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
> > does Microsofts'  method of name mangling prohibit such things?
> 
> No it can't. In general, C++ compilers don't interoperate. The C++-Lite
> FAQ has a section on this.
> 
> >From memory, the issues are:
> *name mangling
> *VMT layout
> *new[] management
> *exception handling
> 
> If you want to use cygwin C++ from MSVC, write some C bindings for the
> code.

Apologies for this blast from the past.  As you can see I'm nearly 7(!)
months behind in the mailing list.  (But I'm catching up!)

All the FAQ says about this is the following:

  Q.  Can I mix objects compiled with msvc++ and gcc?

  A.  Yes, but only if you are combining C object files. MSVC C++ uses
      a different mangling scheme than GNU C++, so you will have
      difficulties combining C++ objects.

I'd like to include the extra detail that Robert goes into, if it's
correct.  Does anyone know for sure?

Thanks for your help.

Regards,
David
(Cygwin FAQ maintainer)


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02 16:19   ` Robert Collins
  2002-10-02 16:59     ` Paul G.
@ 2002-10-02 18:12     ` Shankar Unni
  2003-04-21  0:21     ` David Starks-Browning
  2 siblings, 0 replies; 10+ messages in thread
From: Shankar Unni @ 2002-10-02 18:12 UTC (permalink / raw)
  To: cygwin

On 10/2/2002 4:19 PM, Robert Collins wrote:

> No it can't. In general, C++ compilers don't interoperate. The C++-Lite
> FAQ has a section on this.
> From memory, the issues are:
> *VMT layout
 > [..]

And before someone jumps up and asks why this can't be reverse 
engineered - apart from the general difficulty of the task, there are 
even potential patent issues, as Microsoft claims to have patented some 
clever VMT layout and optimization algorithms that they use for VC++. 
It's unclear whether another compiler can use the same algorithm (to 
match VC++) without running afoul of these patents..




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
@ 2002-10-02 17:05 Paul G.
  0 siblings, 0 replies; 10+ messages in thread
From: Paul G. @ 2002-10-02 17:05 UTC (permalink / raw)
  To: Robert Collins; +Cc: cygwin

Thank you, Rob.

On 3 Oct 2002 at 9:19, Robert Collins wrote:

> On Thu, 2002-10-03 at 09:13, Paul G. wrote:
> 
> > 	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
> > does Microsofts'  method of name mangling prohibit such things?
> 
> No it can't. In general, C++ compilers don't interoperate. The C++-Lite
> FAQ has a section on this.
> 
> From memory, the issues are:
> *name mangling
> *VMT layout
> *new[] management
> *exception handling
> 
> If you want to use cygwin C++ from MSVC, write some C bindings for the
> code.
> 
> Rob

		Paul G.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02 16:19   ` Robert Collins
@ 2002-10-02 16:59     ` Paul G.
  2002-10-02 18:12     ` Shankar Unni
  2003-04-21  0:21     ` David Starks-Browning
  2 siblings, 0 replies; 10+ messages in thread
From: Paul G. @ 2002-10-02 16:59 UTC (permalink / raw)
  To: Robert Collins; +Cc: cygwin

Thank you, Rob.

On 3 Oct 2002 at 9:19, Robert Collins wrote:

> On Thu, 2002-10-03 at 09:13, Paul G. wrote:
> 
> > 	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
> > does Microsofts'  method of name mangling prohibit such things?
> 
> No it can't. In general, C++ compilers don't interoperate. The C++-Lite
> FAQ has a section on this.
> 
> From memory, the issues are:
> *name mangling
> *VMT layout
> *new[] management
> *exception handling
> 
> If you want to use cygwin C++ from MSVC, write some C bindings for the
> code.
> 
> Rob

		Paul G.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02 16:12 ` Paul G.
@ 2002-10-02 16:19   ` Robert Collins
  2002-10-02 16:59     ` Paul G.
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Robert Collins @ 2002-10-02 16:19 UTC (permalink / raw)
  To: pgarceau; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

On Thu, 2002-10-03 at 09:13, Paul G. wrote:

> 	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
> does Microsofts'  method of name mangling prohibit such things?

No it can't. In general, C++ compilers don't interoperate. The C++-Lite
FAQ has a section on this.

From memory, the issues are:
*name mangling
*VMT layout
*new[] management
*exception handling

If you want to use cygwin C++ from MSVC, write some C bindings for the
code.

Rob
-- 
---
GPG key available at: http://users.bigpond.net.au/robertc/keys.txt.
---

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02  9:09 Phil Dempster
  2002-10-02  9:39 ` Igor Pechtchanski
@ 2002-10-02 16:12 ` Paul G.
  2002-10-02 16:19   ` Robert Collins
  1 sibling, 1 reply; 10+ messages in thread
From: Paul G. @ 2002-10-02 16:12 UTC (permalink / raw)
  To: cygwin

Hi folks,

	Thank you, ahead of time, for your consideration and your replies.

On 2 Oct 2002 at 17:09, Phil Dempster wrote:

> > Try not to add to noise for this list unless it
> > seems necessary for something I am currently
> > porting.  That is my apology ahead of time.
> > 
> > Does msvc/c++ load .dlls generated using
> > gcc -shared  -mno-cygwin?
> 
> You can use gcc compiled DLLs with MSVC compiled
> executables.  However, you won't be able to debug them
> in the MSVC IDE.

	Thank you, Phil.  Thank you again for that clarification.

	On a related note, can Cygwin generate c++ .dlls which are loadable by msvc++ or 
does Microsofts'  method of name mangling prohibit such things?

	Thanks again for your input folks.

	Paul G.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
  2002-10-02  9:09 Phil Dempster
@ 2002-10-02  9:39 ` Igor Pechtchanski
  2002-10-02 16:12 ` Paul G.
  1 sibling, 0 replies; 10+ messages in thread
From: Igor Pechtchanski @ 2002-10-02  9:39 UTC (permalink / raw)
  To: Phil Dempster; +Cc: cygwin

On Wed, 2 Oct 2002, [iso-8859-1] Phil Dempster wrote:

> > Try not to add to noise for this list unless it
> > seems necessary for something I am currently
> > porting.  That is my apology ahead of time.
> >
> > Does msvc/c++ load .dlls generated using
> > gcc -shared  -mno-cygwin?
>
> You can use gcc compiled DLLs with MSVC compiled
> executables.  However, you won't be able to debug them
> in the MSVC IDE.
>
> Hope this helps
> Phil

Phil,
ISTR that there were some differences in function name mangling between
gcc and MSVC...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: .dll question
@ 2002-10-02  9:09 Phil Dempster
  2002-10-02  9:39 ` Igor Pechtchanski
  2002-10-02 16:12 ` Paul G.
  0 siblings, 2 replies; 10+ messages in thread
From: Phil Dempster @ 2002-10-02  9:09 UTC (permalink / raw)
  To: cygwin

> Try not to add to noise for this list unless it
> seems necessary for something I am currently
> porting.  That is my apology ahead of time.
> 
> Does msvc/c++ load .dlls generated using
> gcc -shared  -mno-cygwin?

You can use gcc compiled DLLs with MSVC compiled
executables.  However, you won't be able to debug them
in the MSVC IDE.

Hope this helps
Phil

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-04-20 14:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-01 16:45 .dll question Paul G.
2002-10-02  9:09 Phil Dempster
2002-10-02  9:39 ` Igor Pechtchanski
2002-10-02 16:12 ` Paul G.
2002-10-02 16:19   ` Robert Collins
2002-10-02 16:59     ` Paul G.
2002-10-02 18:12     ` Shankar Unni
2003-04-21  0:21     ` David Starks-Browning
2003-04-21  2:20       ` Dan Kegel
2002-10-02 17:05 Paul G.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).