Skip to main content

Questions tagged [visual-c++]

Microsoft Visual C++ is a C, C++ and C++/CLI compiler for Windows. The most recent version of the compiler is Visual C++ 2022. The compiler supports the following languages: C (supports C90 and most of C99, C11, C17 parts of the ISO C++ standard as of Visual Studio 2022); C++ (support for most C++11, C++14, C++17, and C++20 features and few C++23 features as of Visual Studio 2022) C++/CLI (Provide interoperability with .NET languages like C#).

visual-c++
0 votes
2 answers
48 views

No operator "<<" does not correspond to these operands

My C++ program below is supposed to read a json file called english.json and display the "title" information. #include <iostream> #include <fstream> #include <json/value.h> ...
Anorak The Omniscient's user avatar
0 votes
0 answers
38 views

Weird behaviour with 'if constexpr' and templates in MSVC

The code below behaves incorrectly. When f<0> or f<5> is called, it prints as if k = true, but the if statement behaves as if k = false. When f<1> is called, it does the opposite. ...
daniel creatd's user avatar
0 votes
0 answers
38 views

C++: ODR and extern "C" on MSVC linker

I'm testing out how the Windows link.exe program reacts when presented with ODR violations. My intention is that the linker will fail when it notices that my program has two definitions of the same ...
Martin's user avatar
  • 1,005
0 votes
0 answers
10 views

How to make MSVC++ modules from NuGet available to import?

I want to publish my C++ modules to NuGet. However, tests have found that users are unable to import ixx modules in NuGet as they would with header files. import ModuleFromNuGet; //Failed to build; ...
埃博拉酱's user avatar
-3 votes
0 answers
51 views

how to solve include<iostream> problem on vs code? [duplicate]

i have tried a lot. still unable to solve the problem. dont even know why is it happening. { "configurations": [ { "name": "Win32", &...
Imran's user avatar
  • 1
0 votes
1 answer
21 views

Can anyone explain this error message ? C5275

I am facing a bad situation while trying to build an assembly DLL from C++ code, for .NET 7.0. The compiler reports the messages below, even before it attempts to compile. (By the way, this should be ...
Yves Daoust's user avatar
0 votes
1 answer
40 views

C++ lib build Windows VS2022: Build fails with platform toolset v143 - works with platform toolset v142

I am having the following issue with building a simple library (FLANN) from source on windows. I get the code and use CMAKE to generate the VSSolution. Note that I am disabling python, c and matlab ...
Rafael Scudelari de Macedo's user avatar
0 votes
0 answers
9 views

MSVC Linker: /NODEFAULTLIB and /DEFAULTLIB option

I noticed that the MSVC linker from Microsoft has among many other options these two options: /NODEFAULTLIB and /DEFAULTLIB. The documentation says: By default, /NODEFAULTLIB removes all default ...
Sam's user avatar
  • 1,572
0 votes
0 answers
24 views

Cmake Nested Projects Static Linking Problem with glew32s.lib and glfw3.lib [duplicate]

I am developing a library to easily create an OpenGL window context and display an image on it. I have two CMakeLists.txt files. The first one (top project) is for the .exe file, and the second one (...
Thow's user avatar
  • 55
1 vote
0 answers
92 views

Speed-up byte signature scanning in memory using SIMD

I'm searching for various byte patterns in big memory chunks using this code: BOOLEAN Find(const unsigned char* data, SIZE_T data_size, const unsigned char* to_find, SIZE_T to_find_size, SIZE_T* index)...
Kracken's user avatar
  • 682
0 votes
1 answer
13 views

Is there a way to "expand" an enum in C++ for "type-switching"?

For a project I need an observer class (owned by a Subject that then notifies all of its observers) that handles other behaviours. These observers work by calling their onNotify( Event* ) method that ...
thegrult's user avatar
3 votes
0 answers
68 views

Is there a MSVC warning for using 0 instead of nullptr?

GCC and Clang have -Wzero-as-null-pointer-constant to flag the legacy use of 0 instead of nullptr. Does MSVC have a similar warning?
Bolpat's user avatar
  • 1,626
0 votes
0 answers
23 views

New to visual C++: Problem with saving a bmp from a frame after loading the bmp into it

So I've been using chatgpt to help (please don't start with the AI hate). But basically it can't find what is wrong. Please bear in mind that this app is my first attempt at building anything with ...
New_to_dotnet's user avatar
0 votes
1 answer
56 views

Is there an MSVC equivalent to gcc's __attribute__(returns_nonnull))?

I learned about this little feature of GCC/Clang today: Something * MyFunctionThatNeverReturnsNULL() __attribute__((returns_nonnull)) { // code here that will never return a NULL value static ...
Jeremy Friesner's user avatar
0 votes
0 answers
19 views

Compare two strings easily with Unicode support

to understand C++, I'm trying to program a comparator between two character strings. The first variable can be a constant because it is the one being compared. In my case it necessarily contains ...
FallenScriptKiddie's user avatar

15 30 50 per page
1
2 3 4 5
2116