Good to hear :)
You could also link statically for example:

lib some_lib : some_source.cpp<link>static ;

Which could be simpler but would also extend you linking time if you plan to do big project.

Regards


W dniu 30 stycznia 2012 11:34 użytkownik Karsten Ahnert <karsten.ahnert@ambrosys.de> napisał:
Ok, thank you! That solved the problem. I only had to use _WIN32 in #ifdef.

There is also a boost preprocessor symbol for this declaration:
BOOST_SYMBOL_EXPORT.






On 01/30/2012 10:31 AM, Jarosław Bober wrote:
> Ahh sorry I didn't looked at your project before and assumed that you
> have problem with boost itself. Yes, those flags are only for boost libs.
>
> What you're trying to do is to make shared libs (this is the default
> behaviour of boost-build), in linux it works out of the box.
> In Windows however you have to declare export symbols with something
> like this:
>
> __declspec(dllexport) void tree_func( int a );
>
> To support multiplatform you can do something like this:
>
> #ifdef WIN32
> #define EXPORTED __declspec(dllexport)
> #else
> #define EXPORTED
> #endif
>
> and then have your declaration:
>
> EXPORTED void tree_func( int a );
>
> Regards
>
> 2012/1/30 Karsten Ahnert <karsten.ahnert@ambrosys.de
> <mailto:karsten.ahnert@ambrosys.de>>
>
>     Ok, I also tried this. It does not work. I thought that
>     BOOST_ALL_NO_LIBS is only for the boost libraries (filesystem,
>     program_option, etc..).
>
>     Am 30.01.2012 09:43, schrieb Jarosław Bober:
>>     The flag I was talking about is BOOST_ALL_NO_LIB not
>>     BOOST_ALL_NO_LIBS.
>>     You are right that this flags controll automatic linking. So when
>>     you do it manually, you're linking to shared libraries (unless
>>     you're directly linking to static version).
>>     But automatic linking wants static if you haven't declared
>>     BOOST_ALL_DYN_LINK somewhere.
>>     I had the same problem. Try this in jamroot:
>>
>>     project :
>>         requirements
>>         <define>BOOST_ALL_NO_LIB
>>     ;
>>
>>     Hope this helps.
>>
>>     2012/1/30 Karsten Ahnert <karsten.ahnert@ambrosys.de
>>     <mailto:karsten.ahnert@ambrosys.de>>
>>
>>         I defined BOOST_ALL_NO_LIBS=1, but the problem is still the
>>         same. I think BOOST_ALL_NO_LIBS controlls automatic linking of
>>         the boost libraries. Any other ideas?
>>
>>         Am 30.01.2012 09:05, schrieb Jarosław Bober:
>>>         >From first sight it looks like you have automatic linking
>>>         turned on. This thing works only on windows, that's why
>>>         you're fine on linux.
>>>         Perhaps you should turn this off by defining flag
>>>         BOOST_ALL_NO_LIB.
>>>
>>>         Regards
>>>
>>>         2012/1/28 Dr. Karsten Ahnert <karsten.ahnert@ambrosys.de
>>>         <mailto:karsten.ahnert@ambrosys.de>>
>>>
>>>             Hi,
>>>
>>>             I have a a project with several dynamic libraries and
>>>             some applications. Some of these libraries depend on
>>>             other libraries.
>>>
>>>             In the Jamroot I created aliases to all libraries and in
>>>             the Jamfiles for the single library I include all depend
>>>             libraries via these aliases. This works fine on linux
>>>             (boost 1.48) but does not work on Windows machines. The
>>>             problem is that bjam tries to find the static versions of
>>>             the depended libraries which have not been build:
>>>
>>>             LINK : fatal error LNK1181: cannot open input file '*.lib'
>>>
>>>             I attached a small self contained example. Any ideas how
>>>             I can fix this?
>>>
>>>             Thank you,
>>>
>>>             Karsten
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build