Category "c++"

Visual Studio Code: how to add arguments for g++ compiler?

I want to use some C++17 features that Mac's clang doesn't currently support, so I use brew install gcc --HEAD to install the g++ 10.0.1 version. Codes run w

Why reading MachineGUID is a virus?

Why is it that when I read SOFTWARE\Microsoft\Cryptography\MachineGuid from the registry, my program is detected by the Windows Defender as a virus?

cmake: statically link against opencv libs

On Ubuntu 20.04: sudo apt install libopencv-dev Result: kwu@Dev-KWu:/usr$ find . -name "*opencv_imgproc*" -o -name "*opencv_core*" ./lib/x86_64-linux-gnu/libope

How do i hide the bug image once its hit by a bullet in opengl and c++

I am working on defender/space invaders game. I have drawn bug sprite and a bullet sprite. I shoot at the bug with a bullet but when the bullet hits the bug it

OOP sobreencapsulation

Lately I've been learning something about blockchain and I decided to try to make one in c++, without libraries that were made specifically for that, just with

What is an undefined reference/unresolved external symbol error and how do I fix it?

What are undefined reference/unresolved external symbol errors? What are common causes and how to fix/prevent them?

my compiler gives an error E0393 using a pointer to an incomplete type of the "String" class::Srep" is not allowed in inline functions

I tried to write a custom type from a book, my compiler gives an error E0393 using a pointer to an incomplete type of the "String" class::Srep" is not allowed i

Refreshing a Variable multiple times a frame(for a texture array in a shader)

I want to Update an integer multiple times in frame so that the fragment-shader can access the right index of a texture array for different objects. I first tri

Poco addRecursive Not Returning to Normal Program Flow

I implemented Poco in my C++ application for Windows in VS 2019 using tips from this post: How to use Poco::ZIP to compress/decompress zip file I have figured o

What does this char string related piece of C++ code do?

bool check(const char *text) { char c; while (c = *text++) { if ((c & 0x80) && ((*text) & 0x80)) { return true;

How to use OpenGL to draw a text over a Android MediaPlayer?

I have a cpp code implementing a media player behavior on Android. I'm using the media player for playing a mp4 file however, I need to draw text above this. Fo

Save page of WebKitWebView into file

I have this almost solved. I've found this function: void webkit_web_view_save_to_file (WebKitWebView *web_view, GFile *file,

Unable to get output of a Python script with qprocess

I am trying to get the output of a Python script with qprocess but I can't seem to make it work. I think the issue is with the script since I can get the output

Return a lambda from a lambda

I want to use a lambda to evaluate (switch-case) some conditions and return a lambda accordingly. const auto lmb1 = []() { printf("1\n"); }; const auto lmb

Loading TensorFlow model to manipulate an audio stream with C++

I want to load a machine learning model created with TensorFlow into my C++ Audio Application made with JUCE6. In order to use TensorFlow inside C++, I am using

Can 2 processes run on same enclave in intel sgx?

I know intel sgx supports running multiple threads on one enclave. But I'curious that whether I can use fork to run 2 processes on one enclave?

How do we run a single test using Google bazel

For running all the tests under a target I use the command line command bazel test //src/code_path:target_name What should be additional parameters to run a

How does boost graph dijkstra_shortest_paths pick the shortest path when there are multiple shortest paths between a specific pair of nodes?

I have an unweighted, undirected network of around 50000 nodes, from this network I need to extract the shortest path between any pair of nodes. I used the dijk

Calling C++ function using python

I am trying to build python wrapper for a function implemented in C++ that accepts 2d vector and returns 2d vector. I am trying to adapt the code from this to s

solved - OpenCV DNN YOLO V4 with CUDA in Python is 5x Faster than the same code in C++

TL;DR; it was a stupid bug in my code. Not a cuda problem at all. I'm trying to compare the performance of the following code: frames = ... for i in range(2000)