Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-02-27 08:04:36


David Abrahams wrote:

> >> The problem here is that y.cpp has nothing in it to export, so the
> >> linker helpfully decides not to create an implib.
> >
> > What is needed to persuade it? A symbol marked with
> > __declspec(dllexport)?
>
> I believe so.
>
> > Could you try modifying dependency-test/foo.jam so that it creates non
> > empty file, and see if this fixed the problem.
>
> Of course I tried to do that, but I couldn't figure out where y.cpp
> was coming from ;-)

That's why I suggested to modify foo.jam. The "y.cpp" file is created from
"y.foo" using the only action declared in foo.jam.

> >> BTW, we're going to have to deal with __declspec(dllXXport) somehow if
> >> these tests are going to work on MSVC :-S
> >>
> > :-( I'm thinking that we can use macro called DLLEXPORT and automagically
> > : pass
> >
> > appropriate <define> property to bjam invocations. Sounds dirty... but no
> > better insights yet.
>
> Usually you want a separate macro associated with each target, whose
> meaning changes based on the target name. So, in a single header:
>
> // impexp.hpp
> #ifndef _Win32
> # define SHARED_SYMBOL(lib_id)
> #else
> # define SHARED_SYMBOL(lib_id)
> __declspec(BOOST_PP_IF(lib_id##SOURCE,dllexport,dllimport)) #endif
>
>
> // foo.h
> #include "impexp.hpp"
> void SHARED_SYMBOL(FOO_) foo(char*);
>
> Then you put <define>FOO_SOURCE in the requirements for foolib.

That that the symbol is marked as exported when compiling the lib, and
imported for all users? OK, there's no problem with extra includes/defines
for sources that go into library. But each test should create "impexp.hpp".
Should there be a method in Tester which creates it?

- Volodya

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk