Boost logo

Boost Users :

Subject: Re: [Boost-users] is boost::container::static_vector header only library?
From: Klebsch, Mario (Mario.Klebsch_at_[hidden])
Date: 2019-01-17 08:03:05


Hi,

> has to be built, is there a way to use this library as header only
> library?

When I use boost, I usually don't link any pre-compiled libraries. I get undefined symbols at link time and I can add the missing boost source files for those undefined symbols. Most of the time I have to add libs\system\src\error_code.cpp.

On Windows I #define BOOST_ALL_NO_LIB to disable the linker from automatically linking the boost libraries.

Note: When using boost::thread on Windows in a DLL, I have to add calls to boost::on_process_enter(), boost::on_thread_enter(), boost::on_thread_exit() and boost::on_process_exit() in DllMain() and provide an empty boost::tss_cleanup_implemented().

This way the boost sources are always compiled with the same compiler options as the rest of my code.

I am not sure, whether this approach really works with all boost libraries on all supported platforms. I only use a limited subset (smart pointers, noncopyable, lexical_cast, bind, function, thread, asio, filesystem, regex) on windows, Linux, MacOSX and iOS.

I hope this can help.

73, Mario


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net