Category "c++"

Different C++ fork() behavior between CentOS 7.5 & RockyLinux 8.4, Ubunu 20.04

I'm working with some legacy code. It works fine on a CentOS 7 system. The args array gets hosed on both a Rocky 8.4 and Ubuntu 20.04 system. I've simplified th

D3D : hardware mip linear blending is different from shader linear blending

I have a d3d application that renders a mip mapped cubemap in a fullscreen quad pixel shader. I stumbled on a weird behavior, and wrote the following test to il

BLE using ESP 32

I am trying to program a BLE client using an ESP32. I have used the attached code (which is the example code from the example section). My problem right now is,

Leetcode Q9 Palindrome Number same code works in Java but not in C++

I tried solving this problem: https://leetcode.com/problems/palindrome-number/ using code: class Solution { public: bool isPalindrome(int x) { int r

Custom substitutions for compression in the Itanium ABI

The Itanium ABI has some rules for compressing identifier for name mangling: for instance, given namespace foo { struct string { void f(); }; }; the f

"ImportError: *.so: cannot open shared object file" after pip installing extension module built with pybind11

I'm running into some peculiar behavior that I don't understand. I have a python/C++ module (call it X) built using pybind11. In my build directory I have build

How can I get the mouse position in a console program?

How can I get the mouse click position in C++ in a Windows console program? (A variable that returns the position of the mouse when clicked) I want to draw a m

Qt creator tracepoint

In Qt creator there are breakpoint settings. So I can put condition like this *(quint16*)((void*)e+0x8)==2 and it works nicely. But I would like to also print a

Repeat a cubemap texture on a cube face with OpenGL

Is it possible to make a cube map texture (GL_TEXTURE_CUBE_MAP_POSITIVE_X...) repeat on a given face with OpenGL? I have a simple unit cube with 24 vertexes cen

Is #include "filename.hpp" actually an undefined behavior?

The C++20 standard states the following about source file inclusion: 15.3:5 (page 437): The implementation shall provide unique mappings for sequences consisti

Is there a way to set jumbo frame with C++ in Windows?

My C++ application uses Gige camera on many various Windows 10 PC. So I wanna set jumbo frame of LAN card of PC programmatically. (when the process starts it is

pyarrow dependency custom build wheel

I am developing a python package using pybind11 which depends on pyarrow to interop between data types in python and C++. Therefore I build apache-arrow with th

clang-format pointer syntax alignment with multiple declarations on one line

With a C++ input file such as: int *p1; int *p2, *p3; I can run clang-format using the Chromium style; which has a Left value for the PointerAlignment option.

Visual Studio C++ static lib function exposing problem

I have created example of using static libraries. The goal is this functionality: DllTestFunctDll.dll links static_lib.lib (contains fnStaticLibrary()) example.

how to convert a buffer to arrow parquet table in c++

I read a parquet file from remote, so get the binary file, which is a buffer. (unsigned char *buffer) How can I convert it to readable table? I can save the buf

Boost ASIO "Bad address" error when passing unique_ptr to completion handler

I'm trying to implement a simple TCP server using ASIO. The main difference here is that I'm using std::unique_ptr to hold the buffers instead of raw pointers a

Big O notation calculation for nested loop

for ( int i = 1; i < n*n*n; i *= n ) { for ( int j = 0; j < n; j += 2 ) { for ( int k = 1; k < n; k *= 3 ) { cout<<k*n;

Mix_PlayChannel function in SDL_mixer

As described in documentation, Mix_PlayChannel function have a 3 parameters: channel: Channel to play on, or -1 for the first free unreserved channel. chunk: Sa

Creating installer using cpack and windeployqt, To contain qt and VTK libraries

Trying to package an application with Microsoft Visual Studio 2022 and qt6 libraries I do not no were to start from. I've done a bit of research most people use

Why is std::reverse_iterator slower than a direct iterator?

I noticed that std::reverse_iterator always decrements a copy of internal iterator before dereference: _GLIBCXX17_CONSTEXPR reference operator*() const { _I