Category "c++"

How to use a Third-Party DLL in Visual Studio Code

I have a couple of header files that call functions from DLL files, and I was wondering how I could provide the link for the header files and DLL files to commu

IMG_Load() with jpg returns "unsupported image format"

I'm trying to load images using SDL2-image, it works when I try to load a .png, but it fails to recognize a .jpg My imports: #include <SDL2/SDL.h> #undef

What should I change in this code to display the point of every node on the route?

This is a C++ code for A star and this code every time when I run it, it will display route randomly. I want instead of the numbers are shown below in the pictu

Trying to implement shadow using OpenGL; depth texture seems correct but shadow is not displaying

trying to implement shadow. I checked my depth texture on a quad, and it seems correct, but the shadow is not displaying. I check my shadow vertex and fragment

C++ While loop not re-assigning string value

I had created a program that counts the amount of vowels in a provided string. It counts the vowels correctly and repeats when the user provides a 'y' or 'Y'. H

Can I define a macro in a header file?

I have a macro definition in MyClass.h, stated as such: #define _BufferSize_ 64 I placed the include directive for MyClass.h inside of main.cpp: #include "M

C++ While loop not re-assigning string value

I had created a program that counts the amount of vowels in a provided string. It counts the vowels correctly and repeats when the user provides a 'y' or 'Y'. H

Why can't I use ament_cpplint with cpplint plugins for various IDEs?

I am working with C++ code with ROS2. ROS2 has code style standards and one of the recommended linters is ament_cpplint, which is slightly different from cpplin

How can I make a function creating tens of thousands of symbolic filesystem links show up in VTUNE?

I'm profiling some binary on CENTOS 7.6 using VTUNE. I've yet to find the function (in vtune output) which is creating tens of thousands of symbolic file system

How to detect non IEEE-754 float, and how to use them?

I'm writing classes for basic types, so that code is logically the same on multiple platforms and compilers (like int_least16_t for int). For fun! (I'm still a

How to generate a symmetric key in C or C++ the same way this script does?

I am implementing Azure DPS (device provisioning service) for my ESP32-based firmware. The bash script I use so far is as follows (where KEY is the primary key

12 hour to 24 hour time conversion

I am trying to write this c++ program from hackerrank but in my output all I am getting is a blank space. The input string is in the form of HH:MM:SSpp where

Compilation error - defining a concrete implementation of templated abstract class [duplicate]

I have an abstract class in my header file: template <class T> class IRepository { public: virtual bool SaveData(Result&

Is there multiple ways to cin vector elements?

I have a program that adds multiple vectors in 1 vector. I saw a method of instead of .push_back to add elements and I used it, but I am wondering why this work

UE4 crash about attachment rules

The problem occurred when I try to change my default pawn's UPROPERTY value has name "MoveSpeed" in during collision function. Otherwise, there is no problem wi

MSVC 2019 and 2022 compiler hangs and is erratic compiling relatively large std::complex arrays in c++17 and c++20

Using the latest C++ MSVC 2019 and 2022 the following code hangs while compiling #include <complex> // const int N = 10000; // about 3 secs // const int N

Save integers from string to vector

I need to save integers from string to vector. Definition of number: each of strings substrings which consists entirely of digits, with a space before the first

Clang compilation into sysroot with newer glibc

I'm trying to compile with a sysroot for Ubuntu 22.04 from a Ubuntu 20.04 image, and I'm having quite a bit of trouble, getting linker errors like these: /usr/b

Why does this two static constexpr int variable behave "differently"?

English is not my first language.Please forgive my syntax mistake. I am new to mutiThread programming, and I am doing a mutiThread Lab about spinLock. A couple

GoogleTest EXPECT_CALL throws uninteresting call warning and returns 0 calls

I am trying to Mock an external library and test what APIs of the library are being called from my interfaces and I have come across a behavior (first time usin