Category "c++"

how do i call a function in my program from a shared library [closed]

i would like to call a function inside my main program from a shared library at runtime without dropping performance main program: using names

Problems when installing cppflow

I am trying to use the c++ wrapper for tensorflow api from https://github.com/serizba/cppflow. I have copied the git repository. Downloaded the tensorflow api

Mozilla Synstorage-rs installation / make fails under RHEL8

I'm currently trying to install mozilla synstorage-RS on a RockyLinux machine, and step by step I could reduce the amount of errors, but now I got stuck. I foun

Cannot link library for macOS-arm64 with executable for macOS-arm64

I have some trouble with creating a build system on a **Monterey M1 MacBook**: So far I have a working Makefile to build and link a library. (simplified: g++ -

Fast floating-point power of 2 on x86_64

Is there a fast way to take 2.0 to some floating-point degree x? I mean something faster than pow(2.0, x) and preferrably what vectorizes well with AVX2. The c

Is synchronization required when passing a cancel flag with P/Invoke?

I am passing a cancel flag by reference (or by pointer) to a C++ DLL by P/Invoke. The flag will be set at some time in C# code, and the C++ code checks for the

Control Relay by MQTT Publish Subcribe

sorry for my bad english, but i'll try my best i have a code like this void mqttCallback(char *topic, byte *payload, unsigned int length) { Serial.print("Mess

How to connect in Qt signal and slot in dynamically added buttons to get in slot index of added button?

I have list with pointers QPushButton: QList<QPushButton*> listButtons; In this code I am adding dynamically buttons listButtons.push_back(new QPushBu

I started learning DSA ,while writing code for stack DS in c++ , I came across this error

I started learning DSA ,while writing code for stack DS in c++ , I came across this error. So, while I was trying fixing it , I get to know that when I am using

How to handle macOS dock Quit action in QML app?

I have a simple ApplicationWindow that should prevent quitting by overriding onClosing signal. However, when the app is closed from macOS dock, the onClosing is

Does GCC support C++20 std::format?

If it doesn't, do you know what compiler or version will? See cppreference/format.

C2039 and C2873 when including `<cctype>` from the STL

I'm trying to compile a project with msvc 2019 compilers that I know has been compiled before. In fact, I'm actually updating the build system for it. I've come

Is it legal to define an anonymous struct?

Is the following code legal?: struct { int x; }; This code simply defines an unnamed structure. I do not intend to create objects of this type, nor do I

How are openCV matrices serialized in Google's mediapipe

Google's mediapipe framework is able to work with openCV matrices across different languages, certainly C++ and Python. Since it uses protocol buffers to commun

What's the right cmake command to cross-compile for Raspberry Pi from M1 Mac?

My title seems general but I need to compile a project for my Raspberry Pi 3b. I want to use Telegram's Bot API server on it, but it takes a lot of time to comp

How to load the MNIST dataset from the datasets in torch C++

I'm new to torch and c++ i want to create a basic simple network that does hand digit recognition this is my Net struct. struct Net:torch::nn::Module { Net(

Getting "json.hpp: No such file or directory" error despite having json.hpp in the same folder as main.cpp

I'm trying to integrate the json c++ library from nlohmann, while simply copying the 'single_include' file to the same directory as my main.cpp file. As per the

How to customize QModbusDataUnit to send hex values in modbus?

I would need to customize the QModbusDataUnit by sending custom hex via modbus, below my code, I'm trying to customize the post but I do not understand how to d

<command-line>:0:3: warning: ISO C++11 requires whitespace after the macro name

I am compiling qt sources (C++) on different version of Ubuntu OS (14.04 and 16.04 LTS). The sources compile (g++) on 14.04 LTS without warnings. But on 16.04 g

How to check for overflow in duration_cast

I need to convert one kind of std::chrono::duration to another kind but I need to know when such a conversion is not possible because the value would not be rep