Re: A solution to warning C4251 - class needs to have dll-interface...?
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 18 Oct 2007 09:44:17 -0500
"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:i4rch35fuvcdpl8jn7skubsf3v7rl8qph8@xxxxxxxxxx
On Wed, 17 Oct 2007 19:22:37 +0200, "Niels Dekker - no return address"
<unknown@xxxxxxxxxxxxxxx> wrote:
It sounds like this scenario won't happen when using an STL container
within
my dllexported class, right? Because the functions of the STL containers
are completely defined by their header files. We're using both VC++ 7.1
and
8.0, with the included STL.
[snip]
Note that sharing C++ objects in this way between modules must be
considered equivalent to static linking for compilation dependency
purposes. In particular, all the modules should be compiled with the same
options, and they must all use the same CRT DLL. It is very important to
understand this, because otherwise, each module will end up with its own
CRT state, including heap, file descriptors, and so forth, and you won't
be
able to fully share C++ objects between modules. For example, if modules X
and Y use different CRTs, you won't be able to delete an object in one
that
was created by the other.
The poster is using different CRT (different VC++ versions). Moreover, it's
different STL headers as well, so there will be ODR violations and therefore
runtime failures.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: A solution to warning C4251 - class needs to have dll-interface...?
- From: Niels Dekker - no return address
- Re: A solution to warning C4251 - class needs to have dll-interface...?
- References:
- A solution to warning C4251 - class needs to have dll-interface...?
- From: Niels Dekker - no return address
- Re: A solution to warning C4251 - class needs to have dll-interface...?
- From: Doug Harrison [MVP]
- Re: A solution to warning C4251 - class needs to have dll-interface...?
- From: Niels Dekker - no return address
- Re: A solution to warning C4251 - class needs to have dll-interface...?
- From: Doug Harrison [MVP]
- A solution to warning C4251 - class needs to have dll-interface...?
- Prev by Date: Re: Using a Windows DLL in Delphi
- Next by Date: Re: recognize .Net controls properly and get infos/styles/properties
- Previous by thread: Re: A solution to warning C4251 - class needs to have dll-interface...?
- Next by thread: Re: A solution to warning C4251 - class needs to have dll-interface...?
- Index(es):
Relevant Pages
|