Click here to Skip to main content
15,889,266 members
Everything / Boost

Boost

Boost

Great Reads

by Martin Vorbrodt
Parsing Command Line Options
by Martin Vorbrodt
Plugins: loading code at runtime
by Dave Ceddia
Frameworks like Vue have the notion of “computed properties” – a way to derive some new, possibly complex data based on something passed in. This post covers how to achieve the same result in React.
by Martin Vorbrodt
How to print stack traces

Latest Articles

by Daniel Ramnath
Reverse proxy developed using BOOST 1.75 asynchronous ASIO calls
by Dominik Reichl
KeePass is a free, open source, light-weight and easy-to-use password manager.
by H_
C++ list comprehension
by DotnetShtien
In this article we will dicuss when new feature added recently to the meta-programming library which is the command contracts.

All Articles

Sort by Updated

Boost 

27 Dec 2023 by Richard MacCutchan
See B2 User Manual - 1.84.0[^].
27 Dec 2023 by Member 15872449
I am using centos 5.11 with gcc-4.6.3 support ,I need to build boost thread library(version 1.82) using the same gcc without upgrading . What I have tried: The commands I used are ./bootstrap.sh ./b2 But running the bootstrap command I am...
7 Nov 2023 by bartello
I wrote a very simple chat server using boost::asio. Everything works as it should. As I just redid the TCPSession class to use "strand", there was an error in the functionality of the class: The server accepts a connection and immediately drops...
7 Jul 2023 by Pratyush Padhy
zstd.obj : error LNK2019: unresolved external symbol _ZSTD_isError referenced in function "public: static void __cdec l boost::iostreams::zstd_error::check(unsigned int)" (?check@zstd_error@iostreams@boost@@SAXI@Z) [C:\Project\MKECC\mkec...
7 Jul 2023 by Rick York
This, "error LNK2019: unresolved external symbol", means the linker can't find a module it needs to build the program. This is usually caused by the module not being built or it was built and can't be found in the directories the linker is...
7 Jul 2023 by CPallini
Possibly some insight here: #59384 (boost uses zstd if present) – MacPorts[^].
3 Nov 2022 by Daniel Ramnath
Reverse proxy developed using BOOST 1.75 asynchronous ASIO calls
13 May 2022 by AVLoureiro
I'm trying to compile a C++ tomography code on RH7. I have previously compiled it on Ubuntu 20.04 with some issues that were easily solved by adding missing includes on the original code. I have limited experience with C++ and I'm still not...
13 May 2022 by AVLoureiro
After a few days, I managed to solve this problem. I configured cmake to use another version of g++ available on the system: -DCMAKE_C_COMPILER=/share/apps/gcc/v7.3.0/bin/gcc -DCMAKE_CXX_COMPILER=/share/apps/gcc/v7.3.0/bin/g++ This allowed me...
11 May 2022 by k5054
Quote: Could this be related to the compiler version? That's quite probable. You might be able to solve it by trying different standard compliance versions. GCC 4.8 compiles by default as C++ 98, you could try setting -std=c++11 for the compile...
13 Jan 2022 by Optimistic76
I am trying to expose a c++ class to python using boost, and extract a object defined in python in c++ side. What I have tried: I defined my c++ class in the file MyInt.h: struct MyInt { int i_; }; If I define the...
13 Jan 2022 by KarstenK
The error messages sound like that the struct isnt marshallable and you need to reconfige the interface. My experience from C# to C++ and vice versa is that native interfaces are the best. You better read Calling C or C++ From Python tutorial to...
29 Oct 2021 by Patrice T
Quote: How to optimize this code for speed any further Assuming the Elo ranking is positive values only: - At cost of count a little larger, min can be just removed from code. Assuming you know the range of values of Elo: - you can set max to a...
29 Oct 2021 by Weird Japanese Shows
Hello, I'm using counting sort for sorting elo rating of players, I've compared many different sorting techniques and decided to use counting sort. Even if counting sort is a little slower than insertion sort, because it's more stable and...
28 Oct 2021 by Rick York
Regarding your comments - they do not explain why you need to use shared_ptr. If you control the lifetime of the objects then you can safely use unique_ptr. I always make sure that I do (control object lifetimes) so I never, ever use shared_ptr...
28 Oct 2021 by Greg Utas
You could try creating locals for r.size() and count[r[i]->elo - min], but it probably won't matter if you're using a decent optimizing compiler. There's probably some overhead caused by boost::shared_ptr. A unique_ptr would be slightly faster,...
19 Oct 2021 by Weird Japanese Shows
Hello guys. I know, the header is not clear enough. Let me explain the situation in detail. I've a server which takes messages from clients, then check if the message type matches any of the existing types via if - else if(there are more than...
19 Oct 2021 by k5054
At a guess: the strings "test1", "test2", "test3" are all very short and maybe the compiler is smart enough to use a "small string optimization", and ends up comparing 64bit ints rather than doing a string compare. You also have a very small...
17 Aug 2021 by Adam Aug2021
Thanks for the help all. Turns out all I had to do was switch from xml to text (ie. xml_oarchive to text_oarchive). Not sure what happened there but I don't have the time to keep fiddling around with it as the beginning of the semester is closing in.
17 Aug 2021 by Adam Aug2021
I currently have a class that uses a pointer vector to another class. Everything has worked fine until I began implementing boost serialization. On the first run with the program, everything works fine and appears to save the data into the .xml...
17 Aug 2021 by Greg Utas
That's a very generic error that doesn't say why abort was called. But press Retry and use the debugger to find the problem. If you don't know how to use a debugger, Visual Studio has lots of documentation about it. Using a debugger is...
28 Jun 2021 by dilsdgr8
My websocket server URL is localhost/webstream/wsocket Iam trying to create a C++ websocket client that connects to this server using boost. tcp::resolver resolver{ioc}; _pws = new websocket::stream(ioc); ...
20 Jun 2021 by viki_10
i have using boost 1.76.0 version . I tried compiling in visual studio 2013. What I have tried: #include #include "boost/process.hpp" int main(int argc, char* argv[]) { boost::process::child *child; } i...
18 Jan 2021 by viki_10
Hi, when i using boost child to create a Spawn Child.parent and child process are created.If terminate a parent process(Ctrl + c ) it terminated, but child process is not Killed. child is alive only.how to kill child process if parent...
18 Jan 2021 by k5054
As Richard pointed out, you can trap Ctrl-C and then pass a signal to the child to exit gracefully. If you are on linux, and you have the source code to the child process, you can set the Parent Death Signal using prctl(PR_SET_PDEATH_SIG,...
13 Feb 2020 by Optimistic76
I'm trying to copile an example of how to create a module callable from python3.7. I think i have done all the steps correctly but when compiling the project i'm getting a lot of unresolved symbol errors (lnk2019). The sources are very simple: ...
13 Jan 2020 by Dominik Reichl
KeePass is a free, open source, light-weight and easy-to-use password manager.
17 Dec 2019 by H_
C++ list comprehension
9 Sep 2019 by DotnetShtien
In this article we will dicuss when new feature added recently to the meta-programming library which is the command contracts.
14 Aug 2019 by essentialSQL
Database indexes explained
8 Aug 2019 by Audiory Researcho
How can I create a minimal Visual Studio Code 2.2 workspace with: 1. C++ library project (if possible *.so - shared library, if not *.a to use with C#) 2. (If required) something instead of C++/CLI wrapper project(it is linux os no MS C++/CLI) may be wrapper on C# side? 3. C# Application...
8 Aug 2019 by Richard MacCutchan
See Platform Invoke (P/Invoke) | Microsoft Docs[^]
10 May 2019 by Stefan_Lang
First of all, you can significantly speed up the calculation of a power expression with a high integer exponent, by repeatedly squaring intermediate results, rather than just multiplying with the base. Here's a sample implementation that you can adapt to your prefered integer type: #include...
10 May 2019 by Member 13663267
Hi all, i am stuck in one euqation in cpp code, please help me to solve it,, I am using, Qt 4.8.7 Compiler MinGW32 (checked with boost library boost 1.70) I want to use below equation in one of the code A = g^a mod p; //g raise to a modulus p. (something like 2^5 % 3) = 32%3 = 2 (This...
29 Mar 2019 by Martin Vorbrodt
How to use cURLpp (C++ wrapper around libcURL) to make a simple HTTP query to ip-api.com in order to retrieve geolocation information of a given host or IP address
21 Mar 2019 by Martin Vorbrodt
Parsing Command Line Options
19 Mar 2019 by Martin Vorbrodt
Plugins: loading code at runtime
16 Mar 2019 by Martin Vorbrodt
How to print stack traces
15 Mar 2019 by Martin Vorbrodt
Blocking queue
14 Mar 2019 by Martin Vorbrodt
How to serialize data to XML
6 Feb 2019 by IAmJoshChang
How to add the Invincible Power-Up Into The Game
14 Nov 2018 by Vlad Neculai Vizitiu
Hello and welcome to part two of the use and abuse of the C# modifier keywords, Last time we looked at the access modifiers that apply to types (class, struct, and enums) and members (fields, methods, nested classes, etc.
28 Oct 2018 by Member 13779003
Hello guys, Please can you help me? I have installed wamp server and I work on a project using bootstrap and php, the data which I insert into database is in Persian language, but when I retrieve my records on web application it shows me it like question marks I don't know what to do pls?? ...
22 Oct 2018 by MehreenTahir
This article will help you get started with socket programming in C++. We will build a TCP server and client using boost.asio library in C++.
14 Aug 2018 by Dave Ceddia
Frameworks like Vue have the notion of “computed properties” – a way to derive some new, possibly complex data based on something passed in. This post covers how to achieve the same result in React.
14 Apr 2018 by George Shagov
Four Boolean Logic induction
29 Jan 2018 by saide_a
yesterday I found out something first when I use cout for printing my structure it works Okey. but when I want to read and write from file this happens, this problem occurs only with use of stack and queue. At second, I used headers for serialization in main function before, but when I use that...
27 Jan 2018 by saide_a
I am new in using boost serialization library. I want to save and load data to and from STL structures using text_iarchive and text_oarchive. I used bellow code for that: mystruct test; test.initial(); { std::ofstream ofs("filename.dat"); boost::archive::text_oarchive ar(ofs); ar &...
19 Dec 2017 by PrafullaVedante
I am in process of migrating my project code to the newer version of boost (1.62 from 1.38). What i am experiencing is a general purpose class "wdirectory_iterator" is missing in the newer version. Is it deprecated ?? What is the alternative for it ? What I have tried: Tried searching for the...
19 Dec 2017 by Jochen Arndt
It has been merged into the C++17 standard: std::filesystem::directory_iterator - cppreference.com[^]. If you still want to use the Boost implementation (and not compiling with C++17 support) you must use an older Boost version or check if it is still there but requires a definition to be enabled.
16 Nov 2017 by Member 13515450
Hi!!! I was going to send a struct from a client to a server using boost::asio::async_write_some, in this case boost::serialization and boost::property_tree come to help, //boost::serialization struct blank { int m_id; std::string m_message; template void...
16 Nov 2017 by KarstenK
Your question is already answered on Stackoverflow.
16 Nov 2017 by ChrisB91
Hi,I'm trying to send large files (~4GB) from a http server to some clients. My server implementation is based on Boosts HTTPServer3 Example HTTPServer3.The problem is, that the files are first completely loaded into memory and then send to the Client.I would like to read chunks of about...
16 Nov 2017 by KarstenK
Take a look at this answer at stackoverflow. Consider splitting the data into smaller chunks in network packet size multiples to minize sending half empty packets. Multiples of 1024 may fit best.
10 Aug 2017 by Piraisudan
When I include header, it will shows syntax error : identifier 'heap_memory' in file thread_heap_alloc.hpp. How to solve this error? What I have tried: I installed boost. And tried differently but i can't solve that error.
10 Aug 2017 by CPallini
Did you try Google? See, for instance, c++ - boost::thread compilation error in Visual Studio 2010 - Stack Overflow[^].
22 Dec 2016 by Member 12903437
While logging using BOOST in task manager the size of memory keeps on increasing it does not delete it. For example if I print 6000 * 24 times the size of .exe(memory) in task manager is increased till the time its logged. Is there any way to free up the memory for boost. using BOOST_LOG_SEV for...
22 Dec 2016 by KarstenK
Detecting memory leaks isnt easy, so you need some tools if you really want to do it. I would try at first to contact some people with deep boost knowledege.Sometimes the task manager is fooling at the first look. Read here how to find memory leaks. And if you want to dig deeper you may find...
25 Nov 2016 by BadJerry
In SQL, you can compare successfully two strings depending on the collationWith Latin1_General_CI_AS, fussballmanager and fußballmanager are considered equal. They are different with SQL_Latin1_General_CP1_CI_AS.I am trying to replicate the same behaviour in C++. I understand it's...
25 Nov 2016 by Jochen Arndt
There is a really good answer about string comparison at this SO thread:c++ - How to compare a "basic_string" using an arbitary locale - Stack Overflow[^].Regarding your SQL examples, both should return false for the example strings when using AS (Accent Sensitive). But I'm not quite sure...
9 Aug 2016 by Kel_
Presents a serverless real-time HTML5 chat application using emitter.io, vuejs and bootstrap.
29 Jul 2016 by PawelBujak
How to avoid blocking long operations in GUI applications, that lead to hung state.
7 Jul 2016 by Zebedee Mason
Software for automatically constructing architecture diagrams and metrics from source code and .NET assemblies is presented. Examples for Visual C++, Python, the Linux kernel, Boost and .NET are discussed.
26 Jun 2016 by bishopnator29a
Saving, Loading and data migration in compact library
30 Apr 2016 by leon de boer
Sergey was close (?
30 Apr 2016 by grayrain
Regular Expression: (?
12 Mar 2016 by Member 10305620
I am facing a strange issue while trying to resolve endpoints using boost resolver in c++.Case:I am trying to connect to a website http://localhostIpAddress/test/ using boost.where local address of server is "172.34.22.11"(say). I am facing the error saying "**resolve: No such host...
12 Mar 2016 by Serkan Onat
when you use raw sockets to implement a protocolfor HTTP you need to follow the steps belowNote : i will use code parts from the sample link you have provided (without testing myself)first find target end point ,you need an IP address and port (default 80 for HTTP) can also be 8080...
9 Mar 2016 by Member 10305620
I have a problem while closing the client app, when server is closed.I have my read thread and a class which implements tcp connection.Code is below:This is in my main file - main.cppvoid thread_handling(){ /* * Start threading only if server is connected, if not connected Exit...
12 Nov 2015 by Jochen Arndt
It seems that you forgot to add the library file to your project. The file name should be libboost-regex*.lib (* = VC version, single/multi thread, release/debug). Look it up in your boost library directory and add it to your project at Linker - Input - Additional Dependencies (the debug...
11 Nov 2015 by Member 12133830
I saw this guide for configuring boost on VS 2010: How to use Boost in Visual Studio 2010.[^]I did exactly what was wrriten (on 64 bit), but changed in (4) to toolset=msvc-14.0 than I tried building this program from boost getting started web: #include "stdafx.h" #include...
15 Oct 2015 by Jochen Arndt
You must add the path to the boost libraries at Library Directories in the Directories Properties Page[^].
15 Oct 2015 by Member 12062486
when I use VS2015 complie a program,it shows > LINK : fatal error LNK1104: can`t open file“libboost_filesystem-vc140-mt-1_58.lib”.( Windows 7 64 bit)Following is the commend I use to complie Boost:b2.exe install --stagedir="c:\temp" address-model=64 --build-type=complete stage
4 Aug 2015 by cocaf
The generic network endpoint (IP address and port) class that can be compared with and cast to/from the protocol aware boost::asio::ip::udp::endpoint and boost::asio::ip::tcp::endpoint objects.
6 Jul 2015 by phillipvoyle
A sample implementation of a minimal http web server using boost::asio in C++
5 Jul 2015 by stevenong_2006
This project is intended for one to create an automated build environment to build the Boost libraries set to be used with VC++ in Visual Studio 2013.
24 Jun 2015 by cxxxxf
Hi, There are link errors when I compile a simple demo.In function `boost::archive::text_oarchive::text_oarchive(std::basic_ostream >&, unsigned int)':demo.cpp:(.text._ZN5boost7archive13text_oarchiveC2ERSoj[_ZN5boost7archive13text_oarchiveC5ERSoj]+0x25):...
2 Jun 2015 by yufengzjj
#include #include class A{public: A(){} ~A(){} template void call_handler(_Handler handler) { handler(); }};class B{public: template void call_handler(_Handler...
6 Apr 2015 by Naveen
An improvisation to boost unit test frame work that will let you run unit test cases in parallel.
4 Apr 2015 by BrainlessLabs.com
In this tip series, we will create a small C++ game engine.
31 Mar 2015 by BrainlessLabs.com
This tip describes a n ary tree structure. We will see how traversal works.
11 Mar 2015 by Member 11500796
struct add_1000 { add_1000(unsigned& r_) : r(r_) {} void operator()(wchar_t) const { r += 1000; } unsigned& r; }; struct add_roman { add_roman(unsigned& r_) : r(r_) {} void operator()(unsigned n) const { r += n; } unsigned&...
1 Feb 2015 by Paul Heil
A quick demonstration of how boost.phoenix makes a messy boost.bind call much easier to read
24 Dec 2014 by johnbMA
Hi:I'm currently working on a Microsoft (unmanaged) C++ project which utilitizes Boost C++ libraries. It's been quite a while since I've done C++ and I have noprevious experience using the Boost libraries.We are using Boost 1.55 and MSVC 2013. We used CMake to generate the Visual...
10 Dec 2014 by Aescleal
For resources that should be shared between other objects and automatically deleted when the last object using that resource is destroyed you use a shared_ptr. If you're using a C++98 compiler then use the implementation from boost or tr1, otherwise use the standard one.You could simplify a...
10 Dec 2014 by C-A-P
I have two classes SslHandshake and SslRequest with according to names functionality.After client and server handshakes are done in the SslHandshake, I pass both sockets to SslRequest and start transferring data from server to client.1. If I is not waiting for finishing of transferring,...
30 Oct 2014 by Vaclav Naydenov
How C++ library YB.ORM can help manipulate the data stored in RDBMS using domain classes. Basic concepts of ORM are explained by examples.
28 Oct 2014 by yux_315
Implement a thread synchronization queue with STL and boost.
16 Oct 2014 by Stefan_Lang
For all i know boost serialization can't serialize a char array. You should be using std::string to hold your strings and just serialize that.If you must use a char array, you can convert it for the purpose of serialization as described here[^]
14 Oct 2014 by Member 11153987
Following is simple boost serialization code, but ClassA.name member can't be serialized and deserialized, anyone can help me? class ClassA{public: int number; char name[64];};templatevoid serialize(Archive & ar, ClassA& g, const unsigned int...
15 Aug 2014 by Sergey Alexandrovich Kryukov
It sounds like you though that the library is the header files. Probably you configured the path to them, so the compiler is happy with you.But no, the main library content is object and library file, not header files. You need to reference all files you want to line to the linker, all you...
15 Aug 2014 by Member 11014998
i downloaded boost library 1.55 and i bootstrap and i linked that to visual studio 2012 by including library path and additional include directory. while i compile my project i have an error as ' cannot open libboost_serialization-vc110-mt-gd-1_54.lib'. i dont know where i have gone wrong?.
18 Jun 2014 by Tsuda Kageyu
Implement a simple-look substitution of BOOST_SCOPE_EXIT using some of the new features of C++0x
8 Jun 2014 by Mr.HA-AS
I want to share a dynamic array of characters between two processes using Boost Shared Memory. I use the following two pieces of code to do that:Producer Process:char *data;unsigned int share_length;unsigned int offset;std::string data_to_share(data + offset, data + offset +...
6 May 2014 by AndyUk06
A non-nonsense guide to setting up Boost threads in Visual Studio environments.
2 May 2014 by Mr.HA-AS
Hello,I am trying to compile my program using b2 tool, I defined a Jamroot file as following to assist in the compilation. When I execute the command 'b2 toolset=gcc', I get multiple error stating that b2 can't find Boost header files like asio.hpp and bind.hpp:So what am I missing in...
27 Apr 2014 by Bartlomiej Filipek
This book is a must-have resource for any C++ developer!
16 Apr 2014 by Member 10271708
ini file may be not in usual, just like: [ip]ip1ip2ip3[domain]do1do2... in windows, there is 'GetPrivateProfileSection', But I want to do it by boost. I know there is a 'boost::property_tree::ini_parser', but read_ini() can not work for the ini format above.Is there...
15 Apr 2014 by CPallini
As suggested, you can easily write your own code for parsing such a simple format (and rewriting it as XML is a good suggestion too). Even Boost.Regex is, in my opinion, overkill for such a format.
31 Mar 2014 by barneyman
The first item in this list[^] appears to what you're after