|
Boost : |
From: Paul Selormey (paul_at_[hidden])
Date: 2001-01-10 19:17:23
Right. There is more to it as I have already pointed out to John Maddock.
At least your modification is still imcomplete, you will still need the DLL
for the application to run.
# if defined BOOST_DECL_EXPORTS
# define BOOST_DECL __declspec(dllexport)
# else
# define BOOST_DECL __declspec(dllimport)
# endif
Unfortunately, my compiler is now running into "internal error.
Therefore, I cannot submit my modifications now.
However, something similar to the following I made to the regular expression
library should work
#ifdef BOOST_RE_AS_DLL //---using it as a DLL?
#ifdef BOOST_RE_BUILD_DLL //---building the DLL?
#define BOOST_RE_IX_DECL __declspec( dllexport )
#else
//---using the DLL
#define BOOST_RE_IX_DECL __declspec( dllimport )
#endif //BOOST_RE_BUILD_DLL
#else
//---not using it as a DLL
#define BOOST_RE_IX_DECL
#endif //BOOST_RE_AS_DLL
#include "regex_library_include.hpp"
Instead of the following
#ifdef _DLL //<--- it is not true that this is defined in DLL build it is
rather similar to _MT!!!
#ifdef BOOST_RE_BUILD_DLL
#define BOOST_RE_IX_DECL __declspec( dllexport )
#elif !defined(BOOST_REGEX_LIBRARY_INCLUDE_HPP) &&
!defined(BOOST_RE_NO_LIB)
#define BOOST_RE_IX_DECL __declspec( dllimport )
#endif
#endif
#include "regex_library_include.hpp"
Similar modifications are required in the "regex_library_include.hpp" file.
Best regards,
Paul.
----- Original Message -----
From: "Beman Dawes" <beman_at_[hidden]>
To: "Boost.org mailing list" <boost_at_[hidden]>
Sent: Thursday, January 11, 2001 7:33 AM
Subject: [boost] Stupid Win32 DLL vs Static question
> I'm working on prototype build scripts. In testing, I ran into static
> linking problems. In boost/config.hpp we now define this:
>
> # if defined BOOST_DECL_EXPORTS
> # define BOOST_DECL __declspec(dllexport)
> # else
> # define BOOST_DECL __declspec(dllimport)
> # endif
>
> For static linking to also work, doesn't that have to be:
>
> # if defined BOOST_DECL_EXPORTS
> # define BOOST_DECL __declspec(dllexport)
> # elif defined BOOST_DECL_IMPORTS
> # define BOOST_DECL __declspec(dllimport)
> # else
> # define BOOST_DECL
> # endif
>
> And for better error detection, add something like:
>
> # if defined BOOST_DECL_EXPORTS && defined BOOST_DECL_IMPORTS
> # error both BOOST_DECL_EXPORTS && BOOST_DECL_IMPORTS defined
> # endif
>
> mystified-again-by-VC++,
>
> --Beman
>
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk