Questions tagged [c++]
C++ is a general-purpose programming language. Use this tag for questions about/utilizing C++. Do not also tag questions with [c] unless you have a good reason. C and C++ are different languages. Use a versioned tag such as [c++11], [c++20] etc. for questions specific to a standard revision.
165,833
questions with no upvoted or accepted answers
40
votes
0
answers
1k
views
LibXL: excel cross-sheet formulas not updated
I'm dealing with a problem with libXL and Office365.
I created an Excel file with Office 365: a simple formula which shows the content of a cell from another sheet. Then I proceeded to write something ...
30
votes
2
answers
1k
views
Any way to change the behavior of synchronous Windows API SendARP?
I'm writing a local network scanner on Windows to find online hosts with IP Helper Functions, which is equivalent to nmap -PR but without WinPcap. I know SendARP will block and send arp request 3 ...
29
votes
2
answers
839
views
VST3 SDK: Problematic construction of std::string member in ClassInfo object causes program to crash
The Problem:
I'm trying to use the VST Hosting utilities included in the SDK to load a plugin. The code is as shown:
#include "vst/v3/Vst3CommonIncludes.h"
int main()
{
std::string ...
29
votes
1
answer
5k
views
Reliable windowed vsync with OpenGL on Windows?
Update 2024-06-26: Question rewritten to include updated information and consolidate research results.
SUMMARY
It seems that vsync with OpenGL is broken on Windows in windowed mode. Even in very ...
27
votes
0
answers
459
views
SDL2, gpg::GameServices and multi windows
I'm using the C++ SDK for Google Play Game Services in a native application built on top of SDL2. The native part is a .so file loaded at runtime.
Everything works just fine as long as I use the ...
24
votes
0
answers
848
views
std::cos gives different result when run with valgrind
I've discovered an issue impacting several unit tests at my work, which only happens when the unit tests are run with valgrind, in that the value returned from std::cos and std::sin are different for ...
19
votes
1
answer
1k
views
Configure netbeans 8.0 gdb to work with gradle cpp plugin
Lately I've switched from Visual Studio in Windows 7 to Ubuntu with Netbeans 8.0 (C++). From that time I have big problem with debugging my application from NetBeans (gdb works perfectly fine). I have ...
18
votes
2
answers
2k
views
AddressSanitizer interceptor_via_fun
Would like to suppress the following error detected by AddressSanitizer.
==114064==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe60fee2f0 at pc 0x000001e6ef34 bp 0x7ffe60feb6c0 sp ...
17
votes
0
answers
5k
views
Usage guidelines for Prometheus C++?
I've looked at the syntax example in prometheus-cpp and the very similar go one in the main prometheus documentation, and I'm not sure how I'm supposed to use similar code in my C++ application. Go ...
16
votes
0
answers
4k
views
Memory barriers in DirectX and OpenGL
I am trying to sort out memory barrier functions in DirectX and OpenGL. My ultimate goal is to implement HLSL memory barrier functions in GLSL. I found that documentation for both DX and GL is rather ...
16
votes
4
answers
1k
views
VS2012 how to show documentation of standard C++ libraries via IntelliSense?
I started learning C++ a few days ago using Visual Studio 2012. I'm used to programming Java with IntelliJ IDEA and there you always get shown the documentation and expected arguments when calling a ...
15
votes
1
answer
2k
views
What happens when I double click an executable, technically
tl;dr
I'm trying to understand the difference of running a program directly via double clicking the executable vs running it through a terminal or programatically via CreateProcess in windows 10.
...
14
votes
2
answers
590
views
Why can't the compiler optimize a single throw statement in a try-catch block?
I was just playing around with some C++ code at Compiler Explorer and noticed some unexpected behavior when compiling a simple try/catch block. Both of the following snippets were compiled with gcc ...
14
votes
0
answers
476
views
Why `std::invalid_argument` is not caught with no-rtti in macOS M1 environment?
Today I met a weird behaviour in catching exceptions in C++, could anyone clarify it to me? Code snippe
#include <iostream>
#include <string>
#include <exception>
int main() {
try ...
14
votes
0
answers
2k
views
How to generate non-temporal instructions?
Intel's compiler has a pragma that can be used to generate non-temporal stores. For example, I can write
void square(const double* x, double* y, int n) {
#pragma vector nontemporal
for (int i=0; i&...