Category "c++"

visual studio error e1696 -"cannot open source file iostream"

When I build a cmake project in visual studio and this error occurs, I tried to uninstall and reinstall visual studio but it did not work. the Build succeeded a

Initializing container of unique_ptrs from initializer list fails with GCC 4.7

I am trying to initialise an std::vector<std::unique_ptr<std::string>> in a way that is equivalent to an example from Bjarne Stroustrup's C++11 FAQ:

how to configure bazel toolchain for cross compile use rules_foreign_cc

my project need cross compile for arm aarch64 on ubuntu x86_64, but failed at configure stage, below is log log # Execution platform: //platforms:linux_gcc9_aar

LNK1117: syntax error in option 'VERSION:.' with qmake

On Qt5 project using Microsoft compiler, the qmake .pro project file have DATE = $$system(wmic os get LocalDateTime > $$OUT_PWD/wmic.txt) DATE = $$cat($$OUT_

Initialising two large 2D array of 401X401 and do fast matrix multiplication in C++

I want to initialise two 2D matrices of size 401X401 and multiply them in a speedy way. But most probably due to stack overflow, two double 2D matrices were not

how to properly link mingw libraries using cmake and vcpkg?

I've getting used to simple cmake codes like this cmake_minimum_required(VERSION 3.20) project(trial VERSION 0.1.0) set(CMAKE_CXX_STANDARD 20) find_package(fm

asio How to change the executor inside an awaitable?

I have read this question and tried to replicate the answer with the following code: #include <iostream> #include <syncstream> #include <thread&g

mingw32-make fails in cmd due to temporary errors of non-literal type and non-trivial destructor in open CV sources

I need to inject Open CV to Qt according to this tutorial, but at the stage mingw32-make on cmd I got en error. C:/opencv/sources/3rdparty/protobuf/src/goog

how to properly link mingw libraries using cmake and vcpkg?

I've getting used to simple cmake codes like this cmake_minimum_required(VERSION 3.20) project(trial VERSION 0.1.0) set(CMAKE_CXX_STANDARD 20) find_package(fm

asio How to change the executor inside an awaitable?

I have read this question and tried to replicate the answer with the following code: #include <iostream> #include <syncstream> #include <thread&g

How to hide a console in makefile

I am making something in Raylib C++ and every time I open the .exe file, the console and the raylib window opens up. How can stop/hide the console from opening

What is underlying data structure of std::deque and how does it's iterator work?

I know that std::deque has the different chunks of contiguous memory and iterator is invalidated by inserting or erasing the middle of deque. In addition to it,

Can't Print array with multiple data types

I created a struct named products that contains multiple data types: struct products{ int ID; string Name; double Price; int Quantity; }; Then

Why the code show "Debug Assertion Failed!" message? [duplicate]

I trying to make a C++ code that delete occurrences of an element if it occurs more than "n" times, when I debug the code, apears a window wit

Best HID device communication libary C++

I want to send bytes to a HID device. I've allready tried libhid but I can't get it to work. Does anyone know a libary or a easy way to send bytes via. HID in C

What serves the same purpose of Java volatile in C++?

I learned the volatile keyword in Java. It serves as a mean to ensure visibility in other threads when a variable is written by one particular thread. It does t

I have an issue with includePath

I have an error with inlcudePath here is what it says. #include errors detected. Please update your includePath. Squiggles are disabled for this translation uni

why am I getting segmentation fault instead of a garbage value output?

The following piece of code always gives garbage value as output. I am aware of the reasoning behind it as a dangling pointer is created which still points to t

LEMON Graph library: Inheritance in Maps

in my PhD project, I want to create a graph using LEMON. The graph itself is directed and hierarchical meaning that the graph has a tree-like shape. The leaves

When is the compiler allowed to optimize away a validity check of an enum or enum class type value in C++?

While searching for an answer to the question above, I came across the answer of Luke Kowald to the question Check if a value is defined in an C enum?. It state