Category "c++"

getrawinputdata within a simple main()

I am trying to read values from the joystick using simple C++ techniques and Windows. My aim is to write a program that sends a keyboard command whenever the jo

lld runs LTO even if -fno-lto is passed

I have a CMake project with several subprojects that create static libraries built with -flto=thin. The project has a lot of tests that are linked against the a

How to install gstreamer 1.0 badplugin for opencv?

On a Ubuntu 18.04 machine I am trying to use opencv 4.1.2 facedetect in a gstreamer 1.14.5 pipeline but unfortunately the plugin is not installed. I downloaded

How to shrink the size of a WTL application?

WTL applications are quite small already. However, using VS 2005 a statically linked application with WTL 9.10 weighs in at 136 kB (139,264 Bytes) for the Win32

malloc(): memory corruption (fast)

I just started to learn data structure and getting an error when executing malloc(): memory corruption (fast) what can be the issue and how to resolve it? I h

Ternary operator implicit cast to base class

Consider this piece of code: struct Base { int x; }; struct Bar : Base { int y; }; struct Foo : Base { int z; }; Bar* bar = new Bar; Foo* foo =

Why does new int() work like an array in C++?

As far as I understand int* p = new int(); Is something like creating an int with a constructor. If so why does the following code work like an array? int* p =

How can I make sure `iostream` is available to the linker?

I have the following C++ code in a file called helloworld.cpp: #include<iostream> int main() { std::cout << "Hello, World!\n"; } I would like

SNMP client error when authentication with MD5 algorithm

The Ubuntu SNMP client worked correctly with SHA authentication, but failed with MD5. Error: Authentication failure (incorrect password, community or key) snmpd

Create an identifier at compile time that has the line number as part of it [duplicate]

I want a C++ preprocessor macro that creates a new identifier with the line number as part of it. This is for using the identifier as a throwa

Need Help Understanding OpenMP Matrix Multiplication C++ code

Here is my Matrix Multiplication C++ OpenMP code that I have written. I am trying to use OpenMP to optimize the program. The sequential code speed was 7 seconds

Using bullet physics car and heightfield, car get stuck how can I fix?

I've been working on implementing a car in my game using bullet physics. The physics of the car uses btRaycastVehicle and the code is mostly based on the ForkLi

How to read a .txt file from terminal, and then extract contents from file?

I am wanting to use C++ to extract the contents of a .txt file (that will be pointed to from the terminal) that is to be parsed, but I am not sure how to go abo

How to use select to properly detect whether I am building C++ code in Windows or Linux?

I am writing a sample C++ project that uses Bazel to serve as an example idiom for other collaborators to follow. Here is the repository: https://github.com/th

normalize histogram in c++ - function normalize in openCV

I need to normalize the histogram of an image f which mean to applicated an transformation of histogram from image in order to extend the range of value of f to

Use macro definitions (e.g. M_PI) in math.h as float not double

I noticed that all the mathematical constants are declared as double, which leads to conversion problems on some platforms where no double precision units exist

Struggling with libssh on Windows

The problem I'm trying to build a project in Visual Studio 2015 on Win10 that makes use of libssh, but I'm having no luck getting it to work. I feel like I'm l

Windows Open Dialog Box hangs forever with Address Sanitizer enabled

When Address Sanitizer is enabled, the Open Dialog Box cannot be shown. It hangs forever. Thank you. It hangs when running hr = pFileOpen->Show(N

IDE Font spacing problems

A couple months ago, the font I was using in the NetBeans IDE suddenly had huge spaces between each letter, making it almost unreadable. (I was using the Papyru

Can I launch a cooperative kernel without passing an array of pointers?

The CUDA runtime API allows us to launch kernels using the variable-number-of-arguments triple-chevron syntax: my_kernel<<<grid_dims, block_dims, shar