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#).

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

How to Set the Global MSVC Toolset Version in Visual Studio 2022 (Not Per Project)?

I'm encountering an issue with Visual Studio 2022 ver 17.7.4 and Unreal Engine 5.3. It seems that Unreal Engine is detecting my MSVC toolset version as 14.29, but I have MSVC toolset version 14.37....
ark1974's user avatar
  • 623
0 votes
0 answers
22 views

_mm256_setr_epi64x causing wrong results on x86 msvc v143 build with /arch:AVX

I have been pondering this for a week now, it is probably a compiler bug, but I can't be completely sure. I'm using MSVC - 19.37.32822.0 with cmake, my target_compile_options are /utf-8 /W3 /bigobj /...
Dimo Markov's user avatar
-2 votes
0 answers
42 views

How update c++ version?

I installed clang using msys, in msys also check for updates through pacman -Syu and -Su. All versions of MC VS C++ packages are installed on the computer. How i can update it? enter image description ...
Илья Подъянов's user avatar
-2 votes
0 answers
61 views

Order of evalutation in c++ [duplicate]

I am a beginner to c++ programming,i came across this question in my assignment, the question asks to determine the output of the following code #include<iostream> #include <cmath> int ...
Entoninus's user avatar
0 votes
0 answers
60 views

MFC "Failed to create empty document" only in debug setting in Visual Studio

When I run my MFC SDI application, the "Failed to create empty document" pop-up message occurs at startup only in the debug setting. I checked this question (MFC error "Failed to create ...
starriet's user avatar
  • 2,627
0 votes
1 answer
22 views

Changing the icon of an executable in Visual Studio 2022?

I am programming in C++ using Visual Studio 2022 and I'd like to change the icon of my executable (.exe). So far I've only found out how to do that for Visual Studio 2019 or C#. Is there a way to do ...
BenediktS's user avatar
0 votes
1 answer
34 views

Previously working executable now gives application error at runtime

I recently copied C++ source code I am developing in VS2017 from my desktop (running Win 10) to my new laptop (running Win 11). Although the code compiles and links successfully, I now encounter a ...
James Benson's user avatar
0 votes
0 answers
14 views

Writing to and Reading from the Clipboard in an afxwin application

I'm updating a large application in C++, which uses afxwin. I want to copy/paste information between instances of the application using the clipboard. BUT in the afxwin header, the OpenClipboard ...
vauna's user avatar
  • 1
-2 votes
1 answer
63 views

Solution for this small programm (Wrong output) [closed]

#include <iostream> #include <cctype> using namespace std; int main() { int numberofnames; cin >> numberofnames; string* arr = new string[numberofnames]; // Created ...
frogProg's user avatar
0 votes
0 answers
50 views

Getting higher precision win32 timestamps for rawinput than millisecond

I am using raw input as my input api for my game and I was looking to get time stamps for the input presses. But everything I find is at millisecond precision (GetMessageTime()). Which is not good ...
yosmo78's user avatar
  • 487
-2 votes
0 answers
19 views

Appearance of Residual Images When Moving Objects in a Qt Application 5.0

When I implement separate objects in different classes and synchronize them in a widget, residual images appear when moving. At first, I suspected that the issue was related to incorrectly set ...
tix01's user avatar
  • 1
2 votes
1 answer
89 views

why MSVC fails with T<void(ClassName)>?

I have something like: #include <iostream> #include <algorithm> using namespace std; namespace SMSpp_di_unipi_it { #define SMSpp_insert_in_factory_h ...
dmeoli's user avatar
  • 21
0 votes
0 answers
60 views

Encoding Problems with C++ std::string to C# managed System::String

I'm implementing a C++ DLL which has to interoperate with C# code (and Unity framework), hence I need to be able to convert a std::string to System::String in C++. For this purpose, I wrote the ...
BullyWiiPlaza's user avatar
0 votes
0 answers
52 views

MFC static control not displayed correctly

I work on W10, using MFC. I try to display a static control which should be a simple white rectangle with simple text in it and see what I get : enter image description here The little window with &...
jpp320's user avatar
  • 1
1 vote
1 answer
55 views

Why does using QWORD in MSVC give an "invalid operand type" error?

I am learning elementary in-line assembly for self-intrest, and was playing around with defining some load-in-memory instructions. After figuring out how to transfer a byte (defined as a char) array ...
Captain Quack's user avatar
0 votes
0 answers
8 views

Path of MinGW-w64 to add to environment variables

I was recently installing MinGW on my PC using the instructions given in the link at the bottom, however, the path of the MinGW-w64 bin folder (C:\msys64\ucrt64\bin) provided there does not even exist....
Mujtaba Ali's user avatar
0 votes
0 answers
12 views

How to resize n-dimensional array using method in template class?

I want to create some class which let us do operations on n-dimensional vectors (finally my goal is having a tensor class). Firstly I used generation of data type of such tensors from here. template&...
LuBeiTu23's user avatar
-4 votes
0 answers
39 views

cuda - calling a kernel function from .h file gives a syntax error : ‘<’

I am writing a cuda project, which uses quite a lot template classes and template global functions. The implementations of these template classes and template global functions are all in their ...
dsqx's user avatar
  • 1
-1 votes
0 answers
21 views

Error while installing dlib python package

You must use Visual Studio to build a python extension on windows. If you are getting this error it means you have not installed Visual C++. Note that there are many flavors of Visual Studio,...
Pola Ganesh's user avatar
1 vote
1 answer
34 views

Hiding visible columns in Windows Explorer via IColumnManager of Windows Shell doesn't work

Background: Expert in C#/.NET, Basic knowledge in C++/MFC/Windows Shell Environment: Windows 10 (German), Visual Studio 2017 (15.9.56), C++, Windows SDK 10.0.19041.0 Task: Showing/Hiding columns in ...
user22593048's user avatar
0 votes
1 answer
51 views

How do I correctly compile wxWidgets with VS Code and MSVC?

I am currently working on developing a GUI front-end for a console-based C++ application using wxWidgets (I decided against dancing with Qt's licensing conditions). I've been doing all the work for ...
Taylor Grossenbacher's user avatar
-1 votes
1 answer
71 views

Build or Linker order in Microsoft Visual Studio 2022 [duplicate]

This is a question about Microsoft Visual Studio 2022 I have multiple files A.h and A.cpp, B.h and B.cpp, and finally, C.h and C.cpp. A.h class A { private: A(); static A* Instance; } A.cpp ...
Gijahara's user avatar
0 votes
0 answers
17 views

CMF1107 error when building full PDB in VS 2022

I have a project in VS 2022. When I started it without debugging, it didn't show up as I expected. When I select "Build full program database file for solution", the linker generate CMF1107. ...
tomsimi's user avatar
1 vote
0 answers
73 views

Problem with returning large struct in Visual Studio 2013

This might seem obsolete, but I am working on a program that is supposed to work on Windows XP 32bit - we are still using a couple of those because of old EEG recorder that is incompatible with ...
Adam Kalina's user avatar
0 votes
1 answer
29 views

Disabling code optimizations brings exceptions

I'm debugging some third party app in Visual C++ 2019. The default App configuration is set to full optimization (Maximum Optimization (Favor Speed (/O2))) and the project do compiles and run with no ...
Derek81's user avatar
  • 151
-2 votes
0 answers
49 views

Returning a const value by reference works - why? [duplicate]

const int& check(int x) { return 2 * x; } int main() { const int& something = check(3); // First option int something2 = check(5); // Second option cout << ...
Zig302's user avatar
  • 33
0 votes
2 answers
69 views

How to call DoDataExchange on child dialogs in MFC

I am following this article: Creating embedded dialogs in MFC I have got it compiling in my test project but I have one issue. At the end of the article it states: One final point to note that even ...
Andrew Truckle's user avatar
-1 votes
0 answers
29 views

Including <iostream> causes "Error LNK2038 : mismatch detected" when done in one file but not in another [duplicate]

I have a project that has 4 classes, all with .h and .cpp files main block mesh chunk main.cpp includes chunk.h chunk.cpp includes block.h and mesh.h The project is configured to be built as an ...
Amakazor's user avatar
2 votes
1 answer
51 views

VC++ Standard Lib - possible compiler datatype declaration error for int_fast16_t and uint_fast16_t

While building the table below and hovering over over the unremarked std::int_fast16_t and std::uint_fast16_t i found that they are declared as int and unsigend int, rather then short and unsigned ...
Morph's user avatar
  • 204
0 votes
0 answers
16 views

Migrating VS2012 Project to VS2022 ==> Getting Linking errors, seems that directory can't properly parsed

I migrate a VS2012 proj into VS2022 proj and was able to solve a lot of problems. I'm in the last step which makes me trouble. It looks like that the linker can't parse the directory for specific dll'...
Dirk's user avatar
  • 121
-1 votes
1 answer
58 views

Why _read() function of Windows cannot read from STDOUT?

I am able to read() from STDOUT on linux,but in Windows, I can only read from STDIN and write to STDOUT. Below is the code, I am using on Windows: #include <io.h> // Include for _read() #...
Vishal's user avatar
  • 77
0 votes
1 answer
63 views

Visual Studio 2022 Installer not Bundling VC++ Redistributable

We have a C# application using a C++ wrapper DLL class in a C++ project. When we created the setup/msi and installed it, the application is not running, as the necessary files referenced by the Visual ...
Razack's user avatar
  • 1,846
0 votes
0 answers
37 views

OpenCV Issue with imread() in an image from an absolute path after conversion from Unicode wchar_t

I am a beginner to win32 api and opencv working on an app which uses windows File Explorer to choose an image. I am using provided code from windows GetFileNameFromHandle to get a complete path and ...
mhs's user avatar
  • 1
1 vote
1 answer
63 views

Is there pre-defined operators for raylib's Vector2 in C++?

Are these operators pre-defined or am I doing something wrong? I did try to compile but also gave same error. By the way, same is happenning with all Vector2 ops.:( Here is the code: #include "...
super turkey's user avatar
1 vote
3 answers
91 views

Is `typedef` of a function standard C syntax, and how does it differ from a `typedef` of a function pointer?

Function pointers are often declared using typedef in C programs: typedef int (*PFN_RETURNING_INT)(int, int); The * indicates that this a pointer, to a function taking two int arguments and returning ...
John Källén's user avatar
3 votes
1 answer
94 views

Why can't I specialize a template with an alias template in the return type in MSVC?

MSVC refuses to compile this: #include <type_traits> struct G { void operator()() const { } }; template<class T> using MyTrait = std::is_void<T>; struct S { template<class ...
user541686's user avatar
  • 205k
0 votes
1 answer
37 views

How to create an import library for kernel32.dll using a .def file on x86?

I have a small project that does not depend on the CRT or windows sdk. In order to link against kernel32.dll I created a minimal .def file with only the couple functions I need: LIBRARY kernel32.dll ...
lelgetrekt's user avatar
2 votes
1 answer
29 views

MSVC compiled code hits debug assert when using _Atomic float

I have the following code: static _Atomic float testf; void func() { testf=1.0f; float f=testf; printf("%f\n", f); } Running it causes the program to hit a Debug Assert, Invalid ...
TrayMan's user avatar
  • 7,212
0 votes
0 answers
23 views

I create this case 02 for create bill function. code is running well but the calculation always give 0 as the output

I create a case 02 for calculate the bill. function is running but the problem is when the output is coming as a 0. that's problem in my code. Further Information's I cannot find where is the error ...
Tharindu Darshana's user avatar
-1 votes
0 answers
27 views

Is manually including the CMAKE_TOOLCHAIN_FILE required or optional?

I wanted to start using vcpkg for package management for my hobby C++ app, alongside which CMake, which I've been using for a while. I use MSVC 2022 for IDE. I followed the Getting Started guide at 1, ...
Dess's user avatar
  • 2,064
1 vote
1 answer
72 views

serialize with Cereal in MFC

I'm trying to use cereal (C++ serialization library) in the MFC project. It works fine if I add an "internal serialize function" inside of the custom struct that I want to serialize. But, if ...
starriet's user avatar
  • 2,627
-3 votes
0 answers
36 views

How to delete pointer to pointer in C++? [duplicate]

I was trying to understand the relation of pointer to pointer concept. What I understood is we can chain pointers to another pointers and we can read their address, name, value and which address they ...
Ajinkya Bhushan's user avatar
1 vote
1 answer
32 views

Erlang installation failed in W10

Relates to this question. I'm trying to set up RabbitMQ on a W10 machine. This apparently involves installing Erlang 64-bit, as Admin. Downloaded the .exe and tried running as Admin. Fails. The end of ...
mike rodent's user avatar
  • 14.3k
1 vote
1 answer
67 views

Boost ASIO crashes while calling callback function

I am new to boost library. I have written a server using boost beast async methods, but sometimes it got crashed. The scenario is not common, sometime it will take 3-4 hr to get crashed. I am sharing ...
Lalit Sharma's user avatar
-1 votes
2 answers
65 views

C++ ReadFile Entirely, where size>2GB (Win64)

Files show up in the 1.1GB-3.1GB range. Server has 64GB of RAM (The smaller servers have 24). So I figure I'll just read the whole thing into memory instead of using chunks. (Chunks may land outside ...
Kenneth Hippolite's user avatar
1 vote
1 answer
36 views

Can't compile 64 bit CXTipListBox

I am trying to take the CXTipListBox from the classes here: https://www.codeproject.com/Articles/4438/XTipComboBox-Display-tooltips-for-combobox To use it for a CListBox control on a dialog. It ...
Andrew Truckle's user avatar
-1 votes
0 answers
16 views

Build VC++ 6.0 Project on Window 8.1

I have a download project that use .dsp file. So I have tried to build .exe file through VC++ 6.0. I have some following issues: VC++ 6.0 only supports for up to window 8. But for some reason, my ...
manh hung nguyen's user avatar
0 votes
0 answers
24 views

How do I call lib file entry points that don't have underscore

I'm using the pre-built binaries for OpenSSL Win64, and in the lib files they have methods such as SSL_write. When I call SSL_write in my Visual C++ code and do a Build, the linker says it can't find ...
Don Payette's user avatar
-1 votes
0 answers
59 views

Setting a function pointer member to a lambda: issue with msvc, C++14

As for the context, this question is a follow up on this one #include <iostream> class Dummy { public: void (*Foo)() noexcept = nullptr; void InitFuns() { Foo = []() noexcept ...
Oersted's user avatar
  • 866

1
2 3 4 5
630