Questions tagged [boost]
Boost is a large collection of high-quality libraries intended for use in C++. Boost is free, and is often considered a "second standard library".
27,653
questions
-1
votes
0
answers
37
views
C++: Possible memory leak question involving boost::calendar [closed]
I am trying to learn C++ and am attempting to program an app for tracking budget.
I represent each entry as a struct:
struct Entry{
int funds;
int periodicFundsIncrease;
int period;
...
1
vote
1
answer
16
views
Why is an alias target Boost::headers with the same name already existing?
My CMakeLists.txt is including the boost library in the following way:
cmake_minimum_required(VERSION 3.28)
set(BOOST_INCLUDE_LIBRARIES filesystem iostreams log program_options system)
set(...
0
votes
0
answers
16
views
LNK1104 cannot open file 'libboost_filesystem-vc143-mt-gd-x64-1_83.lib'
Severity Code Description Project File Line Suppression State Details
Error LNK1104 cannot open file 'libboost_filesystem-vc143-mt-gd-x64-1_83.lib' Proiect IP test C:\Proiect IP test\...
1
vote
1
answer
46
views
Function returning a custom struct that includes a boost::multi_array
I have this apparently simple code, but boost complains about a dimension mismatch:
#include <iostream>
#include <fstream>
#include "boost/multi_array.hpp"
struct t_struct {
...
0
votes
1
answer
47
views
Using boost::push_relabel_max_flow
I am having trouble calculating the maximum flow for a given graph using boost::push_relabel_max_flow. I've written the following code:
std::map<Graph::edge_descriptor, long> edge2rescap;
boost::...
0
votes
0
answers
21
views
Error with linking Boost::Filesystem with Conan and CMAKE? What to do?
Here's source code
#define BOOST_SYSTEM_DYN_LINK
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/asio.hpp>
#include <boost/regex.hpp>
#include <boost/...
0
votes
0
answers
26
views
How should I add more messages to send
Based on the example from boost https://www.boost.org/doc/libs/1_80_0/doc/html/boost_asio/example/cpp11/echo/async_tcp_echo_server.cpp.
Implements a client that connects to the server and sends data.
...
2
votes
1
answer
61
views
What is the issue of boost::asio async_connect in my server?
#include <iostream>
#include <string>
#include <boost/asio.hpp>
#include <boost/asio/thread_pool.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>...
-1
votes
1
answer
63
views
network settings for running a boost asio server on localhost [closed]
I wrote a client client.cpp and a server server.cpp and they compile well. But I don't know how to connect client.cpp to server.cpp in localhost
I wrote the codes with Boost.Asio and they compile well,...
1
vote
1
answer
17
views
undefined reference to `boost::re_detail
I am catkin_make VINS-MONO,and the error:
undefined reference to `boost::re_detail`
undefined reference to `boost::filesystem::detail::directory_iterator
comes out,why?
When I compiling the VINS-...
0
votes
0
answers
56
views
Calculating the minimum s,t-cut in a graph with parallel and antiparallel arcs in C++ using boost
I would like to calculate the minimum s,t-cut in a directed graph, having parallel and antiparallel arcs. I tried to calculate the minimum s,t-cut using boost by first calculating a maximum flow. I ...
0
votes
0
answers
54
views
What are the reason boost async_send can get stuck?
I have a simple TCP client sending data to an endpoint.
I use boost.asio and occasionally the async_send gets stuck - control never returns.
Below is a pseudo code of what is happening (please assume ...
1
vote
1
answer
79
views
+100
Using boost on MacOS with MacPorts
I'm trying to build some software on MacOS that uses boost (specifically boost_system). It all appears to configure and build ok, but when it goes to link it gives the error:
ld: library '...
1
vote
1
answer
24
views
How to properly use indexable in Boost?
In this example, I wrote two methods for allowing rtree.query to work:
A Specialization of indexable for the Entity<float>
A method wrapper
Which one would be better in this case?
#include <...
1
vote
1
answer
59
views
Maximum wait time of boost::asio::steady_timer
How to set maximum waiting time of boost::asio::steady_timer in milliseconds?
When I set boost::asio::chrono::milliseconds::max() than timer returns immediately (why?).
When I set relatively short ...
0
votes
0
answers
22
views
Problem with linking Boost in CLion on Windows
I need to use boost asio under CLion IDE.
When I compile my project I get error
cmd.exe /C "cd . && C:\MinGW\bin\g++.exe -g CMakeFiles/HelloWorld.dir/main.cpp.obj -o HelloWorld.exe -Wl,--...
4
votes
1
answer
106
views
Compilation time of a compile-time binary search
Looking at Boost MP11's implementation of mp_with_index, it seems to perform a binary search to map a runtime value to a compile time constant. This seems to work fine for smaller values, like going ...
-1
votes
3
answers
171
views
How to calculate nth term of higher order GENERALIZED Fibonacci sequence using matrix exponentiation in C++? [duplicate]
I am interested in calculating the nth term of higher order Fibonacci sequence in C++, using matrix exponentiation, while allowing n to be reasonably large (in the range of hundreds).
The sequences I ...
1
vote
1
answer
31
views
How to make Boost contracts visible to clients
I'm looking at using Boost contracts to implement DBC in C++, but I consider a key part of DBC is that both parties to the contract need to be able to see the contract, and I'm having trouble with ...
-1
votes
0
answers
70
views
cannot find -lboost_program_options: No such file or directory
I am attempting to run the following compile command
g++ -std=c++20 -Wall -Wpedantic -Ofast -fdiagnostics-color=always -I ~/boost/boost_1_83_0_install/include/ full_bisimulation.cpp -o ...
1
vote
1
answer
38
views
Boost stream_translator.hpp build error (C2679)
I have a program that will create a config file and read from that config file, I already created the structure for that program.
But when I try to build I get this error in "boost/...
1
vote
1
answer
55
views
Altering Boost Topological Sort
I'm trying to adapt this git page on simultaneously obtaining a topologically sorted list of incoming vertices whilst topologically sorting. The reason I'm doing this is to compare this implementation ...
1
vote
1
answer
65
views
make command doesnt find library in include path
I am very unfamiliar with c++, but I need to run a server written in it for a project. This project contains a CMakeLists.txt, which I "executed" with cmake -Bbuild.
In the build folder ...
0
votes
1
answer
70
views
CMAKE does not find Boost system and thread
With my Boost installation being on D:\boost_1_83_0 and being specified by BOOST_ROOT in my Path-Variable (Users Path Variables), parts of the installation are not found by my mingw64 C++-compiler.
...
0
votes
1
answer
53
views
Adding boost/dynamic_bitset using CPM Package Manager
I have been struggling with this for some time. I use CPM package manager to pull libraries from github for my project. I prefer it this way, instead of other linking methods. I also tried gh:boostorg/...
0
votes
1
answer
78
views
How to determine boost::optional's (and other) API's?
I was trying to go through the boost optional documentation, and I find this with all of the boost docs in that I can't find a clear API definition. I want to determine:
Is there is an operator& ...
2
votes
1
answer
120
views
How to handle long paths using std::filesystem in c++17
On Windows I am trying to iterate and collect all the files in the directory, Also I want to handle long paths and thats why I've added long path prefix (L"\\?\"). but it crashes with c++17'...
1
vote
1
answer
21
views
Boost Log: Filtering named scopes using a settings file
I'm using Boost Log in my project and I want to be able to filter the scopes that I'm currently interested in the console sink, within the settings file.
I have the names scope attribute added using:
...
0
votes
0
answers
21
views
boost python export class got wrong
I build boost python using b2 like this:
.\b2 variant=debug address-model=64 link=static --debug-configuration
and in my home, I use user-config.jam, and change it like this:
using python : 3.12
: E:...
0
votes
1
answer
54
views
Panic from Rust cdylib is causing a fatal runtime error
I'm currently developing a plugin loading system that utilizes C++ Boost to load Rust cdylib modules. Everything is functioning correctly, except when I invoke panic!() within a cdylib. The panic ...
1
vote
1
answer
16
views
Problem with boost named_mutex hanging on Windows
I have a user reporting that the following code in my application's main()
hangs unless he uses "Run as Adminstrator":
ZTRACE_RUNTIME("Checking Mutex");
bip::...
1
vote
1
answer
45
views
Issue with Boost ASIO async_read_until not reading back to back messages
I am implementing a network library using boost.asio. This is the read function for a TCP class.
One of my test cases has a client connect to server, and once the handshake completes, the server ...
0
votes
0
answers
40
views
Add class to python module with boost python
I'm trying to add a C++ class to a Python module passed to the eval() method.
How can I do this?
For example, when I need to add a simple function, I use this code:
#include <boost/python.hpp>
...
2
votes
1
answer
61
views
Boost.asio implement echo server for multiple connections using coroutine
I've modified a unix socket echo server example from boost.asio official webpage, and adopt it to use coroutines.
I'd like to allow this server handle multiple connections simultaneously.
one solution ...
2
votes
1
answer
48
views
Opening Boost Interprocess segment in Constructor of object
I create a map<int, vector<int>> in a Boost Interprocess managed_shared_memory in one process and then want to open it in another process to write to it continually.
The other process ...
4
votes
1
answer
201
views
How does boost pfr get the names of fields of a struct?
In Boost 1.84 (currently in progress):
Big new feature: field names reflection. Added new constexpr boost::pfr::get_name<N, T>() function that returns a std::string_view with a name of field at ...
0
votes
0
answers
47
views
Including boost in CMakeLists.txt (CLion)
I am trying to include boost in my CLion project in CMakeLists.txt and I get an error in linking boost library.
My CMakeLists.txt:
cmake_minimum_required(VERSION 3.25)
project(echo_ap)
set(...
4
votes
2
answers
144
views
Boost library. Jacobian and system setup
Let's assume I have a system of equations:
x^2 + y^2 = 1
x - y = 0
I want to solve this system by Newton's iterative method: J(x) * delta_x = -f(x)
Where J(x) - the Jacobian of this system.
The ...
0
votes
0
answers
35
views
Boost Path not found, makefile
Keeps on saying that boost file does not exist. I am running on gitbash on Windows. The error is below. I don't know how to fix it, I have set include -I flag to my boost directories, and my ...
1
vote
1
answer
35
views
Saving cliques in Boost's implementation of Bron Kerbosch algorithm
I tried using Boost's implementation of the Bron-Kerbosch algorithm to save the cliques in a graph. I am able to write it to a file but not save it within my code directly in a vector of list of nodes ...
2
votes
1
answer
47
views
How to use boost json when exceptions are disabled?
I use a library which cannot use exceptions.
I want to use boost json in my project.
I see that it can work without exceptions, but I get this error:
/home/pache/Boost/boost_1_82_0/boost/json/detail/...
2
votes
1
answer
58
views
boost TCP server does not correctly accept connections under Linux
I'm working on a client/server TCP applications. It works very well under Windows but I'm encountering problems under Linux: the server does not get notified when a new connection is established with ...
0
votes
0
answers
32
views
Visual Studio 2019 - C++ link Boost libraries statically
I'm building a C++ console app in VS 2019 that uses some boost::filesystem functionality. The program runs fine on my development machine, but when I run it on the actual target machine I get:
The ...
0
votes
0
answers
47
views
How to install Boost and use with pybind11
I am trying to use GitHub actions on a Python package with pybind11 that uses Boost. I can install Boost but CMake cannot find it when trying to compile the code.
Here is the workflow yaml file
name: ...
-1
votes
0
answers
15
views
boost \b2 cannot find jamfile in directory libs/config/checks/architecture
I'm trying to build Boost on a Windows 11 PC. Bootstrap.bat ran fine, but .\b2 fails with "could not find a jamfile in directory libs/config/checks/architecture. Well, no wonder; there's no ...
1
vote
1
answer
34
views
Boost OdeInt cannot set class property when entering integration routine
I'm using boost::numeric::odeint to build a custom integrator.
Other than computing the discrete derivative of the state, I'm computing the output equation during each integration step entering ...
2
votes
1
answer
86
views
Creating an asio wrapper around legacy API with a virtual callback
I have a legacy library interfacing with hardware, which is already asynchronous (via interrupts), but would like to create an asio based interface over it. The problem is, that the asio examples of ...
1
vote
1
answer
50
views
Boost translate with memory leaks (ver 1.65.1)
I tried to analyze a simple program like this with valgrind
int main(int argc, char **argv) {
generator gen;
gen.add_messages_path(".");
gen.add_messages_domain("hello"...
1
vote
0
answers
20
views
How to change permission on windows by boost library?
I am on a windows 10 pc and use boost library 1.74.0. I want to change the file permission.
I've seen questions like
How to change file permissions using the Boost library?
However, when I run the ...
2
votes
1
answer
72
views
Why does building Boost from source change the Python version found by CMake?
I am trying to update the Boost version within a Docker image used for builds. As the newest versions of Boost are not available via apt for older Ubuntu versions (in my case 18.04 LTS), I am having ...