It's unofficial but it works https://www.nuget.org/packages/boost/. For Visual Studio 2012, supported platforms: Win32 and x64.
It's huge 235Mb and takes about half an hour to install.
- Open your C++ project. Or create a new one.
- Open Tools | Library Package Manager | Manage NuGet Packages for Solution....
- Search for "boost" in Online | NuGet Official Package Source (Include Prerelease).
- Press the Install button.
- Wait for about 10 minutes.
- Select your C++ project and press Ok.
- Wait for another 10 minutes.
- Close the dialogs.
- Include some boost header files. For example: #include <boost/atomic.hpp>
- Build the project.
Update
The updated boost package doesn't contain compiled libraries (.lib/.dll) any more. Now it's only 15Mb. I've created separate packages for the boost compiled libraries:
- boost_atomic;
- boost_chrono;
- boost_context;
- boost_coroutine;
- boost_date_time;
- boost_exception;
- boost_filesystem;
- boost_graph;
- boost_iostream;
- boost_locale;
- Boost.Log: boost_log, boost_log_setup;
- Boost.Math: boost_math_c99, boost_math_c99f, boost_math_c99l, boost_math_tr1, boost_math_tr1f, boost_math_tr1l;
- boost_program_options;
- boost_random;
- boost_regex;
- Boost.Serialization: boost_serialization, boost_wserialization;
- boost_signals;
- boost_system;
- Boost.Test: boost_prg_exec_monitor, boost_unit_test_framework, test_exec_monitor;
- boost_thread;
- boost_timer;
- boost_wave.
Класс !
ReplyDeleteА официальная поддержка от разработчиков не планируется ?
Честно говоря, не знаю. Если интересно, исходники здесь http://citylizard.codeplex.com/SourceControl/latest#boost/
DeleteНе хватает более обширного спектра компиляторов :)
Delete2008 и 2015 =)
Boost 1.58 for Visual Studio 2015 RC: https://getboost.codeplex.com/releases/view/614815
DeleteThis didn't work for me. This was also my first attempt to use nuget (C++ or native).
ReplyDeleteI was able to get zlib to install with "Install-Package zlib".
When I ran "Install-Package boost -Pre", memory usage spiked from ~70MB to ~2GB, and then I got on out of memory exception in my nuget console output.
For reference, installing zlib "only" made my memory usage go from ~70MB to ~150MB.
I have now tried this on a second machine, and it worked there. I'm not sure what the relevant differences are.
DeleteI noticed that you only package the multi-threaded staticlib versions of the boost libraries (debug and release). People are likely to request the static C-runtime variants, and DLL variants.
Thank you, Ben, for testing the package. Did you run it on Windows 32bit the first time? I think, I should split the package to several Boost libraries but there is no official support for this from Boost community.
DeleteHow should I build the DLLs? Currently I run these commands to build the Boost framework:
bjam msvc architecture=x86 stage --stagedir=stage_x86
bjam msvc architecture=x86 address-model=64 stage --stagedir=stage_x86_64
https://citylizard.codeplex.com/SourceControl/latest#boost/boost.bat
My failing attempt was on a Win7 x64 machine. My good attempt was on a Win8 x64 machine.
DeleteTo answer the question you asked, you can build both the DLLs and the libs by adding link=static,shared to your build lines. That's not the right question to ask though :)
The right question (or at least closer to the right question) is "Which variants of the boost libraries should go in the package?" That's a much harder question.
You could build with "--build-type=complete". This will generate most (but not all) variants. It is also way bigger than you probably want. The 32-bit complete build is 4.32 GB, and it doesn't even include PDBs for the DLLs.
I would argue that the single threaded CRT builds could be discarded, that halves the size.
I've got plenty more to talk about with regards to Boost. If you want to chat more, my email address is in my profile.
Ok, I was trying to split Boost to libraries but it is so hard. So I found a workaround. Package boost contains only headers (about 15 Mb zipped). And then we have pre-compiled packages, such as boost_atomic, boost_context, etc.
DeleteProcedure:
1. Install "boost" package and use it.
2. If you have a linker error ">LINK : fatal error LNK1104: cannot open file 'boost_{NAME_OF_LIBRARY}-vc110-mt-1_54.lib'" then install "boost_{NAME_OF_LIBRARY}" package, for example "boost_atomic" or "boost_wserialization".
3. If you use shared Boost DLLs then copy them from packages/boost_{NAME_OF_LIBRARY}/stage_{PLATFORM}/ folder.
This comment has been removed by the author.
ReplyDeleteСпасибо большое за nupkg.
ReplyDeleteНадеюсь поддержка не прекратится.
Если boost не будет радикально менять структуру, то существующая программа должна достаточно легко генерировать новые пакеты.
ReplyDeletecan you provide some boost_all-vc120, which would depend on all other vc120 packages?
ReplyDeleteThat may be a good idea. I will investigate it. The biggest problem will be download time.
Deletehttps://getboost.codeplex.com/workitem/6
DeleteTry this http://www.nuget.org/packages/boost-vc120
Delete