Boost linked example

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost linked example

Boost - Dev mailing list
Could someone, please, point me to an example (in the Boost source, i.e. a
file in the libs sub-folder) that would require (with certainty) a built
library. Which library don't matter. I've tried some date-time examples and
boost::random::random_device, but it works, while I hoped it wouldn't. The
latter can also mean I have some strays, but then I know that. I would like
to check vcpkg static-static linking for Boost.

Thanks,

degski
--
*"If something cannot go on forever, it will stop" - Herbert Stein*

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost linked example

Boost - Dev mailing list
AMDG

On 07/02/2018 11:54 PM, degski via Boost wrote:
> Could someone, please, point me to an example (in the Boost source, i.e. a
> file in the libs sub-folder) that would require (with certainty) a built
> library. Which library don't matter. I've tried some date-time examples and
> boost::random::random_device, but it works, while I hoped it wouldn't. The
> latter can also mean I have some strays, but then I know that. I would like
> to check vcpkg static-static linking for Boost.
>

  What exactly did you try?  random_device is implemented in
the library, so it shouldn't link if the library is missing.
(Perhaps auto-link is picking up a library that you weren't
expecting?)

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost linked example

Boost - Dev mailing list
On 3 July 2018 at 09:07, Steven Watanabe via Boost <[hidden email]>
wrote:

>   What exactly did you try?  random_device is implemented in
> the library, so it shouldn't link if the library is missing.
>

I tried:

#include <boost/random.hpp>
#include <boost/random/random_device.hpp>
#include <iostream>

int
main()
{

    boost::random::taus88 rng { [ ] ( ) { boost::random::random_device
rdev; return ( static_cast<std::uint64_t> ( rdev ( ) ) << 32 ) | rdev ( );
} ( ) };

    boost::random::uniform_int_distribution<std::int32_t> dist { 0, 100 };

    std::cout << dist ( rng ) << '\n';

    return 0;
}

(Perhaps auto-link is picking up a library that you weren't
> expecting?)
>

I must have a stray then (I'm trying to test the auto-linking and it works,
while it shouldn't), now I have an anchor point, I'll take it from here.

Thanks Steven,


degski
--
*"If something cannot go on forever, it will stop" - Herbert Stein*

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost linked example

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On 3 July 2018 at 09:07, Steven Watanabe via Boost <[hidden email]>
wrote:

>   What exactly did you try?  random_device is implemented in
> the library, so it shouldn't link if the library is missing.
> (Perhaps auto-link is picking up a library that you weren't
> expecting?)
>

 The background to the testing is this issue
<https://github.com/Microsoft/vcpkg/issues/3775> in vcpkg, it doesn't smell
good to me.

--
*"If something cannot go on forever, it will stop" - Herbert Stein*

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost linked example

Boost - Dev mailing list
On 3 July 2018 at 09:24, degski <[hidden email]> wrote:

> On 3 July 2018 at 09:07, Steven Watanabe via Boost <[hidden email]>
> wrote:
>
>>   What exactly did you try?  random_device is implemented in
>> the library, so it shouldn't link if the library is missing.
>> (Perhaps auto-link is picking up a library that you weren't
>> expecting?)
>>
>
>  The background to the testing is this issue
> <https://github.com/Microsoft/vcpkg/issues/3775> in vcpkg, it doesn't
> smell good to me.
>

 I've come more or less to the bottom of this (found the stray). Turning up
the verbosity on the (failing) build output shows that the linker receives
amongst many other things this "z:\vcpkg\installed\x64-windows\lib\*.lib",
i.e. vcpkg is simply linking all libraries (so, I don't get why they do the
fancy erroneous renaming). And yes, it's not good, IMO.

degski
--
*"If something cannot go on forever, it will stop" - Herbert Stein*

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost