Category "c++"

How to set cmake, in order to add txt files into working directory as resource?

CMakeLists.txt cmake_minimum_required(VERSION 3.8) project(untitled) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) add_executable(untitled ${SOURCE_F

C++ generate new EC_KEY using OpenSSL 1.1.1n

I'm very new to this OpenSSL stuff and trying to learn my way through it. I want to generate an ec key but its keep failing to generate. I'm currently using Ope

Opengl GLFW3, Cant update vertices of two object at the same time

So i am trying to make a game where I want to update my player and enemy. enemy and player are squares. I have a square class with VAO, VBO, EBO and vertices wh

Latest VSCode 1.66.2 does not stop on failed assertion in C++ CMake debugging session

My VSCode: Version: 1.66.2 Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:24.808Z Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.

Why is there no warning from -Wfloat-equal when comparing containers of doubles?

If I use the compiler option -Wfloat-equal with GCC or Clang, equality comparisons of float/double values cause a warning. However, when comparing containers (l

Implement alphanumeric sparse arrays in interpreter

VS2022 C++ wxWidgets I'm writing an interpreter, and I want to implement sparse arrays with alphanumeric subscripts and data. I've been researching AVL, B-Tree

How to delete a heap allocated std:::array

I have this pointer in a class: std::array<std::array<std::array<Item*, XSize>, YSize>, ZSize>* Items; In the constructor: Items = new std::a

LLVM beginner: instrument, string type and metadata

I am a beginner in LLVM, and I wanna get the true value of a given varibale name and line number by using LLVM pass. I have several problems. correctly get the

QtCreator Getting Undefined Reference to Qt's own "QNearFieldTarget" Class while using CMake Build System

I'm trying to build an Android App to Debug the NFC communication. However, CMake doesn't seem to neither find nor link the required headers for NFC. QObject et

Why does my for loop not stop when I use an int32_t loop variable? [duplicate]

In my program, I found the loop unable to exit correctly when i is int32_t. It seems like integer overflow, and is much larger than 10, and th

QtCreator issues ld: warning: directory not found for vcpkg Qt

I installed Qt5 with vcpkg on macOS Catalina. And installed QtCreator using the online installer. Then on QtCreatpr, Preferences, Kits, Qt Versions I added qmak

I keep getting this error: expected primary-expression before 'int'

I am trying to solve this exercise on Exercism website. The exercise is about finding the leap year. I have two files, main one and the header file. The main on

Why does CMAKE need two build runs to compile open625251 encryption correctly?

I am somewhat new to CMAKE and need your help. I am building a project that uses the OPCUA library open62541 and after including encryption, the build process i

Build OpenCV for Android with CMake's ExternalProject_Add

I am creating an Android library that uses OpenCV via NDK. It doesn't require any Java parts of OpenCV, native parts only, so I decided not to use OpenCV for An

vector push_back memory access denied in Visual Studio

#include <stdio.h> #include <vector> using namespace std; int main() { vector<int> numbers; numbers.resize(10001); for (int i

how to handle garbage value while making my own vector in c++?

Good evening guys I am trying to make my own vector class. But I have few problems. Firstable, I dont know why There is garbage value I've tried to check constr

Meshes loaded via Assimp look distorted

So I'm trying to load and render mesh with assimp and DirectX11.(Im loosely following tutorials on youtube) The problem is that it looks weird and distorted. I'

When I run the program, I don't get any errors, but after I have already set the value of the variables, I get this error

When I run the program, I don't get any errors: #include <iostream> #include <string.h> using namespace std; int main() { string s1, s2, s3;

ARP sniffer and packet interception

i want to sniff arp replays to be more specific i want to intercept arp packet and retrieve ip addresses using libtins im not quite sure with the filter i put "

Find the K-Beauty of a Number Unexpected Runtime Error

I was recently doing the first question in the Leetcode Biweekly Competition 78, and I received an unexpected runtime error which I couldn't understand, especia