msvcrt

Getting dynamic atexit destructor link error with custom toolset - eh vector destructor

吃可爱长大的小学妹 提交于 2019-12-11 06:39:55
问题 I'm getting a weird linker error when trying to compile against a VS2005 CRT with a Visual Studio 2015 toolset. The same code compiles perfect on any other toolset version (2005,2010,2012,2013). The code must compile under VS2005 CRT to properly link with other projects. How to reproduce: Create a new empty Dynamic Library (dll) project (In VS2015, toolset v140), add a source (.cpp) file: //1.cpp #include <string> static std::wstring thisWillFail[] = { L"test" }; Change the VC++ include

How to Avoid `msvcrt.dll` Compiling with MinGW64?

点点圈 提交于 2019-12-11 06:35:28
问题 I have some C++ code that I compile to various platforms, namely Linux 32/64 bits, Windows 32/64 bits. For the Windows part, I use the latest gcc compiler provided by mingw-w64 package. The trouble I am having is that the 32-bit compilation drags the libc API that Microsoft provides through msvcrt.dll, and that DLL has some problems: is not distributable (it comes with Windows and is not replaceable) has versions (every Windows version has a different one, with added functionality) it depends

Where are the VS2015 UCRT Source files?

南笙酒味 提交于 2019-12-11 05:47:47
问题 TL;DR : Where do I find the MS source files that are referenced as d:\th\minkernel\crts\ucrt\... when debugging in Visual Studio 2015. I'm trying to debug into a CRT call to see what MS is actually doing, and unfortunately it seems the ucrt source files are not available with an installation of VS2015. At least I cannot find these files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src at all. Is the (mostly) full source set of the MS CRT still available somewhere as it used

msvcrt.getch() detects space every time

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:24:28
问题 Im writting a simple python code that should detect the my keystrokes but for some reason in detects space after everysingle keystroke. The code: import msvcrt print("press 'escape' to quit...") text="" while 1: char = msvcrt.getch() print(ord(char)) Sample run: Input: aaaaa Output: 97 0 97 0 97 0 97 0 97 0 回答1: It's not detecting space. Space is 32 , not 0 . What's happening is that you're using a wide-character terminal, but reading it as bytes, so you're seeing the UTF-16-LE bytes. In UTF

what are the differences among the ways to access msvcrt in python on windows?

空扰寡人 提交于 2019-12-11 02:27:39
问题 on windows, what is the difference among the following? import msvcrt as x vs x = ctypes.cdll.msvcrt vs x = ctypes.CDLL(find_library('c')) vs x = ctypes.CDLL(ctypes.util.find_msvcrt()) i believe the doc say the last two are equivalent. but the first two are never (clearly) documented, and seem strictly better. for instance, when running python from some other context that uses a different msvcr*.dll (eg, matlab), replacing the third with the second solved this bug. 来源: https://stackoverflow

Can I throw an exception from _CrtSetReportHook?

蹲街弑〆低调 提交于 2019-12-11 00:52:23
问题 Assuming I'm in a C++ program, I want to convert these reports to exceptions. Is using a C++ throw statement a reasonable way to do it, or am I stuck just redirecting to stderr? 回答1: No, you can not throw C++ exceptions from your hook. It may work some of the time - but in general - when the hook is invoked the CRT is in an indeterminate state and may no longer be able to throw or handle exceptions. Throwing an exception when the CRT is in trouble, is a similar scenario to throwing an

Does _control87() also set the SSE MXCSR Control Register?

元气小坏坏 提交于 2019-12-10 21:23:13
问题 The documentation for _control87 notes: _control87 [...] affect[s] the control words for both the x87 and the SSE2, if present. It seems that the SSE and SSE2 MXCSR control registers are identical, however, there is no mention of the SSE unit in the documentation. Does _control87 affect an SSE unit's MXCSR control register or is this only true for SSE2? 回答1: I dug out an old Pentium III and checked with the following code: #include <Windows.h> #include <float.h> #include <xmmintrin.h>

An application has made an attempt to load the C runtime library incorrectly

荒凉一梦 提交于 2019-12-10 18:29:40
问题 I started getting this error every time I try to: install Python package with installer use PyWin extension (through COM application) start Notepad++ (with Python script plugin) This started to happen couple of days ago. Dialog shows, I dismiss and everything runs fine, except it pops again and again I reinstalled Python 2.7.3 on Windows XP SP3 32bit, then reinstalled PyWin extensions, but nothing changed. Looking for answer here, I found that obviously some library is missing manifest

How does PATH environment affect my running executable from using msvcr90 to msvcr80?

試著忘記壹切 提交于 2019-12-10 17:18:33
问题 #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } I tried putting various versions of MSVCR80.dll under the same directory as the generated executable(via cmake ),but none matched. Is there a general solution for this kinda problem? UPDATE Some answers recommend install the VS redist,but I'm not sure whether or not it will affect my installed

Python input single character without enter

落爺英雄遲暮 提交于 2019-12-10 15:29:13
问题 What I am trying to do is make a simple pi memorization game in Python. What I need is a way to get input from the user without having to press 'enter' after every character. It sounds like I need something like getch, but I can't get it to work. I got a getch-like function from here: https://gist.github.com/chao787/2652257#file-getch-py. I don't really understand anything that's in there. When I do ' x = getch.getch() ' it says " AttributeError: '_Getch' object has no attribute 'getch' ". It