Category "c++"

How to run multiple threads in C++ code

I'm a beginner for c++. I wrote a program to extract data from one DB and store those data to another DB. I just want to add multiple threads to speed up the pr

How to set fix directory for output file in V4 Printer Driver

I am working with V4 printer driver, i need to store output xps file to a specific folder instead of letting user select output folder.

I can't build c++ files anymore

I think i deleted some files i shouldn't and now when i try to build files in Sublime Text it says "g++ is missing" and in VS Code it says "#include errors dete

Get exit status of a process in bash

I have a c++ executable named Test. I want to find out the GetExitCodeProcess() code when the execution is completed. I can find out the status code by writin

How to get free space of all logical drives of hard disk using WMI in C++?

I would like to calculate free space of entire hard drive using c++ and WMI. For example. if HDD contains 3 logical drives say C: , D: , E: and each logical d

Can't open compressed file

I'm trying to compress a text file with QT: QFile inFile("d:\\build\\Directories\\Debug\\files\\developer.txt"); bool open_file_result = inFile.open(QIODevice:

PPF 3D Models Matching OpenCV C++

I am developing an application that: Reads 7 model files and trains a PPF 3D Detector; Reads a scene file and try to match with the detector; Store the resu

LibTorch with OpenCV: version GOMP_5.0 not found

I'm trying to use OpenCV and LibTorch in the same project. Libtorch is installed in /usr/include/libtorch, downloaded from the PyTorch website. I'm using the cx

GTK Image from String

I am trying to display an image based on a string of hex pixel data. The string object being transmitted to me is similar to the following: std::string image_b

C++ Include Guards for Standard Headers

I am wondering if/ what include guards on files like windows.h, math.h, iostream, stdio... etc. Since I have those headers included multiple times in different

Does auto deduce the type at compile time or runtime in C++ 11?

Consider the following auto a = 10; When does the compiler know that a is an int, at compile time or at run-time? If it deduces the type at run-time, will it n

error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj

I was converting my projects from VS2010 to VS2012.But I am getting an _MSC_VER linker error in certain projects. After a long surfing through google I found ou

qemu-system-i386: Error loading uncompressed kernel without PVH ELF Note

Im trying to boot my OS to qemu with this code: qemu-system-i386 -kernel MyOS/mykernel.elf But I keep getting this error: qemu-system-i386: Error loading uncom

How to extract prime numbers from a fibonacci series in C++?

Please help my code is as follows. I have found out the Fibonacci series within a range successfully but I am finding it difficult to extract the prime numbers

How undefined are __builtin_ctz(0) or __builtin_clz(0)?

Background For a long time, gcc has been providing a number of builtin bit-twiddling functions, in particular the number of trailing and leading 0-bits (also f

How do I remove EOF in cin buffer?

I'm using an example to show what I mean: On my Mac, to leave the first "while loop", the user has to type "CTRL+D". From what I understand, that is achieved by

Check if a given ostream object has been written to

Can I query an ostream object about whether or not it has been written to? For an ostringstream, one could use if(!myOssObject.str().empty()) What about the

Why if I use a QImage instead of imread I get a null pixmap.?

I try to execute the next code, But If I use a file Image the code run well but If I tried to use a QImage I get the next error. In the same way I get the error

Windows CreateFile Possible Error Codes

I'm playing around with abstracting Windows, Linux, and Mac File IO calls into macros (to avoid C runtime, so no fopen, fclose, etc...). I've actually got quit

Difference between using .ipp extension and .cpp extension files

Suppose I have 2 header files, 1 .ipp extension file and a main.cpp file: First header file myClass1.h (like interface in Java): template<class T> class m