Questions tagged [boost]

17289 questions
1

votes
2

answer
396

Views

How to use boost::asio::buffer in a method parameter

I am trying to use boost::asio::buffer as a reference parameter in my method like this: void ReadDataIntoBufferPassedIn(boost::asio::buffer & buffer); Firstly, compiler complains that: error: no type named 'buffer' in namespace 'boost::asio' void ReadDataIntoBufferPassedIn(boost::asio::buffer & buff...
Game_Of_Threads
2

votes
0

answer
10

Views

Generate complete iso date time representation strings with fraction and timezone

I want to print an ISO 8601 conforming string of the form of the complete date time representation as in ISO 4.3.2 Complete representations 1985-04-12T10:15:30Z combined with 4.2.2.4 Representations with decimal fraction as 23:20:50,5 combined as allowed in 4.3.3 Representations other t...
Superlokkus
1

votes
1

answer
41

Views

boost graph library example does not compile

I need to do a topological sorting on a graph. Boost graph library can do it. However, an exmaple I found on this site does not compile. The error is 'no member named 'topological_sort' in namespace boost. What is causing this error ? #include #include #include #include #include 'boost/graph/gra...
Ring Zero.
1

votes
1

answer
2.5k

Views

Boost::Serialization Mpi Sending array of user defined types

I want to send my Array class using boost Mpi template class Array { private: int size; T* data; public: // constructors + other stuff }; Here T can be any built in type or user defined type. Suppose I have a class complex struct complex { std::vector real_imag; // contain two elements }; So the que...
Noman Javed
1

votes
3

answer
884

Views

Visual Studio linker cannot find libboost_system

I'm using VS 2008 and want to use the boost::asio library. I could get this to work in a new project (I want to include boost/bind.hpp and boost/asio.hpp), but in an existing project I get this error: fatal error LNK1104: Datei 'libboost_system-vc90-mt-sgd-1_46.lib' cannot be found. I can't find thi...
CppCode_r
1

votes
1

answer
1.6k

Views

linker errors with boost::archive and serialization

I am new to VC++ 12.0 with MFC and also the boost library. However, I need to use the boost library to serialize the vector storing customized data types. I read the examples of DEMO_GPS and used similar codes in my problem. Unfortunately, I came across the following linker errors: 1>SMTDoc.obj : e...
Vincent8Hz
0

votes
1

answer
15

Views

Program abort hangs the named mutex

I have several processes but only one should be running at the time. This means that let's say the Process1 is running and if the Process2 get launched, then Process2 should wait until Process1 is complete. I am considering the boost named_mutex for this purpose. In order to avoid a scenario where m...
BKS
1

votes
2

answer
578

Views

boost python template argument deduction/substitution failed when exporting function

I'm trying to export two overloaded functions to Python. So I first define the pointers to these functions and then I use them to expose the functions to Python. BOOST_PYTHON_MODULE(mylib){ // First define pointers to overloaded function double (*expt_pseudopot02_v1)(double,double,double,const VECTO...
user938720
-3

votes
0

answer
13

Views

How to apply c++ boost pagerank algorithm for non-distributed graphs?

A distributed graph is whose vertices & edges are distributed across multiple processes or address spaces.
kranti sairam
1

votes
1

answer
64

Views

What is the difference between `BOOST_ENDIAN_BIG_BYTE` and `BOOST_ENDIAN_BIG_WORD`?

In the latest release of boost, there are 4 endian macros defined: * `BOOST_ENDIAN_BIG_BYTE`, byte-swapped big-endian. * `BOOST_ENDIAN_BIG_WORD`, word-swapped big-endian. * `BOOST_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian. * `BOOST_ENDIAN_LITTLE_WORD`, word-swapped little-endian. https://www.b...
thc
1

votes
2

answer
76

Views

How to use boost serialization for binary output?

what is difference between functions boost::serialization::binary_object(void * t, size_t size) and boost::serialization::make_binary_object(void * t, size_t size)? How can i use them for getting actual output binary file ?
Pratik Patil
1

votes
1

answer
39

Views

What does boost::asio::io_service::run() actually do?

I have implemented a TCP socket client that connects to the server and uses boost::asio::read() and boost::asio::write() calls. A bit like this: https://www.boost.org/doc/libs/1_63_0/doc/html/boost_asio/example/cpp11/chat/chat_client.cpp However, in my implementation I'm not calling boost::asio::io...
juzzlin
1

votes
1

answer
74

Views

Failure at disambiguating overloaded method

What follows is reduced from a system that stores pointers to methods along with their parameter's types. The user just provides type::method and the template machinery does the rest. When the method is overloaded the user must provide the signature of the desired method. This was working very well...
user643005
3

votes
1

answer
444

Views

How can I install Dlib in a Heroku python web app using requirements.txt?

I built a Python Flask web API that involves machine learning and I've had a lot of frustration deploying it on Heroku. The problem is, my app has a dependency on Dlib ( a library) and I can't seem to find a way to install in my Heroku server. I'm losing my mind trying to fix this and I can imagine...
Nuelsian
1

votes
0

answer
7

Views

Problem connecting websocket from c++ compiled with emscripten

Trying to connect to websocket (poco-1.9.0 samples\WebSocketServer) using c++ code compiled with emscripten. Using compiled boost 1.69 and one of common examples to connect to socket. boost::asio::ssl::context ctxt(context::sslv23_client); ctxt.set_verify_mode(boost::asio::ssl::verify_none); boost:...
Laza
3

votes
1

answer
113

Views

Async sending and receiving custom data packets with boost?

I am trying to asynchronously send and receive custom data packets with boost and I have some questions, based on my current implementation: tcpclient.cpp #include 'tcpclient.h' #include #include '../utils/logger.h' tcpclient::tcpclient(std::string host, int port) : _endpoint(boost::asio::ip::addre...
Kyu96
1

votes
2

answer
667

Views

with tuples and boost.fusion, is there any reason to use struct?

tuples are similar to structs (discussed here: Boost::Tuples vs Structs for return values). it seems that the only advantage is it's more convenient to write struct because it's shorter and by key rather than a number. one can also use fusion map and structs to access by key Boost::Tuples vs Structs...
kirill_igum
1

votes
1

answer
76

Views

boost::log 1.66.0. Argument for set_filter from boost's tutorial is wrong

I'm going thru boost::log library tutorial using Boost 1.66.0 and VS 2017. Get the problem in the very beginning: void init() { logging::core::get()->set_filter ( logging::trivial::severity >= logging::trivial::info ); } Error: No operator '>=' matches these operands ... It looks legitimate - Fir...
egor
1

votes
1

answer
54

Views

Shared buffer using boost::intrusive_ptr

I have a use case where one thread reads message into a large buffer and the distributes the processing to a bunch of threads. The buffer is shared by multiple threads after that. Its read-only and when the last thread finishes, the buffer has to be freed. The buffer is allocated from a lock-free sl...
MGH
1

votes
2

answer
281

Views

C++ compilation stuck with boost interprocess lib 'error: `::ftruncate' has not been declared'

This is what I get when I run make : In file included from /usr/include/boost/interprocess/sync/file_lock.hpp:25:0, from init.cpp:61: /usr/include/boost/interprocess/detail/os_file_functions.hpp: In function `bool boost::interprocess::ipcdetail::truncate_file (boost::interprocess::file_handle_t, std...
ZeroGraviti
1

votes
1

answer
212

Views

Boost-geometry : Polygon definition

Could you please tell me why this polygon definition don't work? namespace bg = boost::geometry; int main() { typedef bg::model::point point_type; typedef bg::model::polygon polygon_type; polygon_type P; int xi[] = {0,100,100,0,0}; int yi[] = {0,0,100,100,0}; bg::append(P, bg::make(*xi, *yi)); doubl...
Ella
1

votes
0

answer
84

Views

How to set and keep GPU utilization?

I have a Kepler Nvidia Card and I need to keep the GPU utilization at a certain amount, say 80%, for a certain duration, say 5 seconds. I know that the GPU utilization amount depends on various factors, but here I need to keep CUDA cores busy. Is there any straightforward way to do it?
Ahmad Siavashi
1

votes
1

answer
113

Views

Parse SQL like query with boost spirit x3

I'm trying to parse a simple SQL like query using boost spirit x3. There were a similar post for the previous version of spirit. But With spirit x3, we don't need grammar. So here is my attempt: // SELECT chr, pos FROM table // Select chr, pos FROM table WHERE a=5 and b = 6 // SELECT chr, pos FROM...
DrIDK
1

votes
0

answer
58

Views

Boost graph library - distributed adjacency list

I've been recently trying to implement an algorithm using distributed adjacency lists, as defined in the BGL documentation (http://www.boost.org/doc/libs/1_46_1/libs/graph_parallel/doc/html/distributed_adjacency_list.html) I am constantly seeing this error: error: ‘mpi’ is not a member of ‘boo...
sdgaw erzswer
1

votes
0

answer
344

Views

Problems with Running MySQL Connector in CLion

I've recently installed MySQL Connector for CLion as I am planning to make a program that would MySQL Databases. I've installed the Connector from the mysql website and tried the code that is provided by the website. After running it, I found that it says that boost/shared_ptr.hpp does not exist. So...
Timothy Susanto
1

votes
0

answer
747

Views

How to use boost stacktrace with Visual Studio

I'm using Visual Studio 2015 and I was thinking to use the new boost-stacktrace library in my projects. Therefore I tried the example in the documentation of boost-stacktrace, but seemingly the output wouldn't help me as it should? This is my little test runner program: #include #include #include...
Aleph0
1

votes
0

answer
68

Views

dlopen'd SO's conflict when unloaded

I have two .so files that statically link boost regex. each of those so's are plugins that get dlopen'd by my main executable. It seems that when I unload one of them, it causes out of bound reads in the other so. My theory is that when one so is unloaded, the other one's copy of boost is actually...
mercurytw
1

votes
1

answer
48

Views

How to iterate over all error_info's in boost::exception?

At the catch site of a boost::exception (or std::exception), I want to iterate over all error_info elements of the exception, without knowing the types. I need to extract all the name-value pairs. I guess it should possible since the boost::diagnostic_information function does that, but I'd like to...
Pat
1

votes
1

answer
151

Views

How to replace the base parameter removed from boost::filesystem::weakly_relative and std::filesystem::canonical

The function boost::filesystem::canonical() (doc of 1.66, doc of current release) offers two arguments (ignoring the error code overload) base. The first one is the path to canonicalize, the second argument is the base path used to make the first path absolute if it is relative. By default current_p...
Matthäus Brandl
1

votes
1

answer
63

Views

Trouble Invoking Move Constructor for Deque with Boost Asio Sockets

I'm trying to write a multithreading web server and I'm having a lot of trouble passing accepted boost::asio::ip::tcp::socket objects from my parent thread to my child threads. My current solution is pretty clanky since I don't think i understand proper class oriented design. Still, I want to get th...
Zeke
1

votes
1

answer
74

Views

Shared Object is statically linked against boost program_options; application links shared

I'm working on a library that is statically linking our boost dependencies so that we do not have to worry about conflicting with users. Our library statically links date_time system thread regex filesystem program options We then have an executable that also needs program_options and links against...
Mike K.
1

votes
1

answer
75

Views

Parsing xml using Boost c++ for nested tags

I am trying to parse an xml file using boost which is of the following structure: 1 10 11 2 12 13 I need to store it in the following class: class root_info { public: //some members std::vector chocos; } class choco_info { int color; int companies[100]; } I have written the following code, but it sh...
coder0007
1

votes
1

answer
130

Views

Aliasing boost::variant or std::variant not compilable

Currently my library uses boost::optional and boost::variant. Since C++17 is out, I would like to add an option, that it works with the boost and std. So I tested the complete code with boost optional and variant and std optional and variant successful. So I added a header files that is similar to t...
Felix Petriconi
1

votes
1

answer
322

Views

How to properly unwrap error code from boost exception

The question is simple, yet I cannot figure out how to do it. I want to get the system_error, and from there get the concrete error code. I have something like this in the error: Dynamic exception type: boost::exception_detail::clone_impl std::exception::what: boost::system::system_error I can catch...
Germán Diago
1

votes
1

answer
191

Views

Reading binary file with batch size using boost serialization

I am trying to serialize the class with boost's binary serializer, and loading the binary data with batch size. I am able to fetch the first 5 records out of 10, and the process is crashing while I am trying to read an another 5 records by re-opening the file and re-setting the file read pointer to...
user3620473
1

votes
0

answer
66

Views

How can I detect a break with boost::asio::serial_port?

I have a device which sends serial data in packets. Each packet is separated by a serial break (a low level on the serial line which lasts longer than a character). How can I detect a break using boost::asio::serial_port ? There is a send_break() function, but I could not find information about rece...
rve
1

votes
1

answer
71

Views

Boost related errors while building a C++ project

I'm trying to build a clone of an old game written in C++ (https://sourceforge.net/p/open-chicken-invaders/code/HEAD/tree/trunk/) but I get some Boost related errors that I can't solve. I tried building this project on Windows, Ubuntu and Raspberry Pi but I get the same errors everytime. The develop...
devlime26
1

votes
0

answer
112

Views

Boost.X3: does not compile with std::optional<std::string>

The following parser does not compile when I use std::optional for values of a -lexeme[+alpha] rule: something breaks in the attribute management. The grammar works fine if instead of std::string I use int as a base type, it also works if I use twice std::string (i.e., no std::optional). However it...
akim
1

votes
1

answer
54

Views

Boost.X3: char_ >> char_ discards the characters and behaves like lit

I would like to parse strings with escaping rules similar to that of C. I want to keep the escapes, not decode them and recode afterwards. So I thought that *(char_('\\') >> char_ | char_ - ''') would do what I want, but it does not: it behaves as if I had written lit('\\') to discard that guy. #d...
akim
1

votes
1

answer
40

Views

boost::program_options parse command line always with empty value

On debian stretch, and gcc 6.4.0, boost 1.66.0 boost::program_options parse command line always with empty value. The code below: #include #include #include #include #include int main(int argc, char* argv[]) { using namespace boost::program_options; options_description desc{'Options'}; desc.add...
Panda

View additional questions