Category "c++"

GetCommTimeouts function failed with error code 50

when I develop a PCIe communication interface, I used CreateFile & Readfile function to operate the device. But when I tried to set timeout to the handle, I

static_assert expression is not an integral constant expression with __builtin_clz

I have the following code: typedef unsigned char uchar; constexpr int leaing_ones(uchar const u8) noexcept { return __builtin_clz(static_cast<uchar>(~s

How to handle "java.lang.UnsatisfiedLinkError" when the library path is satisfied?

I'm trying to export a c++ library function through JNI, I've this header file called "Pylon.h" here's the source code: /* DO NOT EDIT THIS FILE - it is machine

My segment tree update function doesn't work properly

The problem: In this task, you need to write a regular segment tree for the sum. Input The first line contains two integers n and m (1≤n,m≤100000), the s

If MinGW-w64 doesn't support wWinMain, then what C++ compiler should I use instead? [duplicate]

I've been attempting to follow this guide here for writing a program in C++ that allows me to create an application window, however I ran into

'base/debug/debugging_buildflags.h' file not found when building project with webrtc

I am building a project that includes webrtc with CMake, Visual Studio 2019 and ClangCl. This is the command I run to configure : cmake -G "Visual Studio 16 20

C++ How to create a constant pointer to a function?

I want to have a class with a constant pointer to a function as a member. However, I'm instead creating functions with constant return values (a strange feature

cannot convert 'LinkedList::filter(void (*)(Node*))::<lambda(Node*)>' to 'void (*)(Node*)'

Im trying to implement a simple LinkedList class, but this error shows up and I don't understand why. struct Node { public: int val; Node* next; Nod

Compile microsoft rpc server with nmake: Error LNK2001: unresolved external symbol Output

Dear fellow programmers, Currently I am working on implementing a Microsoft RPC server / client program on Windows. Using nmake, I managed to compile the client

How can I implement parallel Cartesian Product efficiently using C++ Cuda

I have two arrays A and B which have m and n int variables respectively. I have a function f, and I want to generate all f(a, b) which a is in A and b is in B:

Qt - Add item from a second window to ListWidget in MainWindow

I have a QDialog where I can enter a Text and add it to a ListWidget inside the MainWindow after I clicked OK. Therefore I created a Method in the MainWindow cl

Tokenize a std::string to a struct

Let's say I have the following string that I want to tokenize as per the delimiter '>': std::string veg = "orange>kiwi>apple>potato"; I want every

std::filesystem::path::u8string might not return valid UTF-8?

Consider this code, running on a Linux system (Compiler Explorer link): #include <filesystem> #include <cstdio> int main() { try {

Weird issues with Clang and C++, and uniform initialization

I was attempting to compile and run the example on this page that explores function pointers as a function input. The example I was running was the 66 line one

CMake - How to handle dependencies of imported library targets with TARGET_RUNTIME_DLLS

In my project I rely on some third party shared library named foo. foo itself is relying on some other third party dll (let's call it bar.dll), which is however

An exception occurred when I use Eigen::PardisoLU with cmake

I am trying to use Eigen::pardisoLU but I have no output. This is my cmakelists.txt: cmake_minimum_required(VERSION 3.9) project(my_test_project) aux_source_dir

Qt - TableView with categories

I am looking to replicate the look of the TableView presented in this picture using Qt. The one in the picture looks to be created with Windows Forms. The mai

Manually building C++ library in bazel (4.2.1) sandbox

For a proof on concept I want to use a CMAKE library in a large bazel (4.2.1) project. In my first attempt I build the library outside bazel by hand and am load

opencv 3.1.0 imread stunked, but imdecode is ok

I'm using opencv 3.1.0, tried to read an image by imread, just like Mat image = cv::imread("1.jpg"); but it stunked without any error message (performs like in

C++ redefinition of function

I have a base class and 3 separate derived classes. All of the .hpp files are structured the same. The .hpp which doesn't work: #ifndef CAESARCIPHER_HPP #define