31,796 questions
Advice
0
votes
0
replies
65
views
How do I display labels on multiple line cell elements simultaneously in VTK?
I'm new to VTK. I use the VC++ compiler and have always drawn objects using Windows GDI/GDI+ and OpenGL. I'm currently switching to VTK for practical reasons, and I'm very happy with it because it ...
0
votes
0
answers
83
views
Cant find `kernel32.lib` despite windows sdk and other tools installed and using correct environment [closed]
i wanted to build a python-c library, so i installed vs build tools 2022. i checked desktop dev with c++ and selected msvc, windows sdk, vcpkg, address sanitizer, cmake and msvc cli. I am on windows ...
4
votes
2
answers
121
views
Cannot specify `__forceinline` for an implementation of a member function in a separate translation unit
Consider the following three files "main.cpp"
#include ".hpp"
__declspec(noinline)
int main(int, char**)
{
x().DoFoo();
x::dobar();
::dobaz();
return 0;
}
"....
0
votes
0
answers
60
views
Is there a way to include debug information into PDB-file selectively?
I build my C++ program in Visual Studio 2022 (cmake-project) using a large static-built library (QT).
The library was built in Debugx64 mode. I want to build program including debug information for it,...
Advice
1
vote
6
replies
145
views
Ai Neural Network | C++ | Project Guidance --- Matrix Part
I’m an undergraduate CS student working on a final project due in about a month, and I’m trying to design and implement a C++-based AI Neural Network Simulator integrated into a small game environment....
6
votes
0
answers
198
views
Why is module std available even though it isn't re-exported?
Consider this simple code with two files:
module.ixx
export module m;
import std;
export namespace m {
struct Object {
std::string_view data() {
return "DATA";
}
};
}
...
1
vote
1
answer
162
views
Why does this valid C++20 code compile on Clang but fail on MSVC with a template deduction error? [closed]
I’m experimenting with C++20 concepts and encountered a compiler discrepancy.
This code compiles on Clang 17 and GCC 13, but MSVC (VS2022) rejects it:
template <typename T>
concept HasFoo = ...
6
votes
0
answers
173
views
Type aliases for functions with auto deduced return type in Visual C++
I found accidently that MSVC compiler from Visual Studio allows one to declare an alias for a function type with auto deduced return type, see T in the example program as follows:
auto l = +[]{ return ...
Best practices
1
vote
2
replies
77
views
Providing stubs to a static library
Environment:
Windows, Visual Studio, low level.
A bit of context:
One of my project is a static library with C functions that export functionalities. Some of those C functions make use of C functions ...
1
vote
1
answer
140
views
Why does initializing std::atomic_flag with false work on GCC and Clang but not Visual Studio?
Here is the code:
#include <atomic>
std::atomic_flag bShouldStop = false;
int main() {
}
Compiles on GCC and Clang but not on Visual Studio, gives errors:
<source>(6): error C2440: '...
0
votes
0
answers
158
views
OpenCppCoverage not reporting untouched files
I have a Visual Studio solution with this architecture:
core.lib
api.dll (imports core.lib, no actual code)
tests.exe (imports core.lib)
I'm running OpenCppCoverage from the root of the solution ...
0
votes
1
answer
170
views
How to compile a 32-bit executable via cl.exe with VS Code?
In the 64-bit Windows 10 OS, I want to compile a 32-bit Windows executable via cl.exe with Visual Studio Code. I have installed C/C++, CMAKE and C/C++ DevTools extensions and installed Visuall C++ ...
5
votes
1
answer
192
views
Optimal code generation for std::isnan in Visual Studio 2026
As far as I know the fastest assembly code for testing that a floating point variable contains Not-a-Number (std::isnan) is comparing it to itself, where not-equal will signify NaN. And as I can see, ...
1
vote
0
answers
88
views
How to install pyaudio for python 3.6 on win7,32-bit PC (with VC++ v.14.29.30139 already installed)
I am trying to install pyaudio on an old win7 32-bit laptop, with Python 3.6.8 already installed.
I have installed the latest compatible version of pip, and then numpy and mapplotlib.
I issue the ...
0
votes
1
answer
155
views
Python func called from C++ not defined
I am having a problem with calling a simple python script from C++. I have a simple testcase to illustrate the problem; In the python script - func fb should call fa which has previously defined.
...