visual-c++

Compile python extension for different C++ runtime

余生长醉 提交于 2021-02-05 10:16:50
问题 I am developing a plugin for plex media server. Plex uses Python 2.7 for plugin system. I need to use python-levenshtein package, which needs to be compiled for different systems. I found python-Levenshtein wheels (manylinux, macos, arm, windows), but the wheel for Windows compiled with VS 2008 (msvcr90.dll). And plex embeded python compiled with VS 2013 (msvcr130.dll). Being on Windows 10 how can i compile python package with different VS runtimes? 回答1: Note: compiling extensions for

Compile python extension for different C++ runtime

微笑、不失礼 提交于 2021-02-05 10:15:30
问题 I am developing a plugin for plex media server. Plex uses Python 2.7 for plugin system. I need to use python-levenshtein package, which needs to be compiled for different systems. I found python-Levenshtein wheels (manylinux, macos, arm, windows), but the wheel for Windows compiled with VS 2008 (msvcr90.dll). And plex embeded python compiled with VS 2013 (msvcr130.dll). Being on Windows 10 how can i compile python package with different VS runtimes? 回答1: Note: compiling extensions for

Unsigned/signed mismatch

旧巷老猫 提交于 2021-02-05 09:33:11
问题 I'm having trouble fixing this warning message. warning C4018: '<' : signed/unsigned mismatch Can anyone help me find out what the problem is? It's located in the bool function at while (i < bin.length()) #include<iostream> #include<string> #include<math.h> using namespace std; void intro(); bool isBinary(string); void decToBin(); string getBin(); void binToDec(string); char getChoice(); char getContinue(); int main() { char choice, cont; string bin; intro(); do{ choice = getChoice(); if

Type cast warning from DWORD to 64 bit pointer

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-05 08:09:10
问题 An old 32 bit C++ application (MS Visual Studio) has code lines like this: m_value = (PUCHAR)someDWORD; Where PUCHAR is a pointer to an unsigned char. Now I have changed to 64 bit and I get a (valid) warning about conversion from DWORD to the 64 bit pointer. My unqualified solution to this is to write like this: m_value = (PUCHAR)(DWARD_PTR)someDWORD; Is this the correct way to fix this warning (and potential runtime error)? 回答1: That savage cast to DWORD_PTR will only pad someDWORD with

Type cast warning from DWORD to 64 bit pointer

前提是你 提交于 2021-02-05 08:07:32
问题 An old 32 bit C++ application (MS Visual Studio) has code lines like this: m_value = (PUCHAR)someDWORD; Where PUCHAR is a pointer to an unsigned char. Now I have changed to 64 bit and I get a (valid) warning about conversion from DWORD to the 64 bit pointer. My unqualified solution to this is to write like this: m_value = (PUCHAR)(DWARD_PTR)someDWORD; Is this the correct way to fix this warning (and potential runtime error)? 回答1: That savage cast to DWORD_PTR will only pad someDWORD with

c++ - const member func, that can be called upon lvalue instances only, using a ref-qualifier

醉酒当歌 提交于 2021-02-05 07:48:31
问题 I'm trying to enforce a const 'getter' method of a class to be called upon only lvalue instances of the class, via a ref-qualifier and for some reason getting an unexpected result (I'm compiling with clang 6.0.1 with C++ 17 support, via c++1z flag, on Windows ): The declaration bool getVal() const &; allows the method to be called on rvalue references also . The declaration bool getVal() &; doesn't allow the method to be called on rvalue references BUT, as I understand - the function isn't a

CPU variable type

大城市里の小女人 提交于 2021-02-05 05:34:05
问题 I was working in Visual Studio when happy little innocent intellisense said there was a variable type called cpu I can't find anything about it online, because all google will return is the Central Processing Unit. Does anyone know what the cpu variable does or stores? 回答1: cpu is a restriction specifier can be applied to function and lambda declarations. complete detail is available here : http://msdn.microsoft.com/en-us/library/vstudio/hh388953%28v=vs.120%29.aspx 来源: https://stackoverflow

Visual C++ methods in vfptr in reverse order

ぐ巨炮叔叔 提交于 2021-02-04 20:57:54
问题 Is there a way to control the order of some classes methods in the vfptr? It seems that Visual C++ 2010 at least puts the method pointers in the declaration order, except for overloaded methods. Below is sample code: enum ENUM { }; class CLASS { virtual void foo1() { }; virtual CLASS& __cdecl operator<<(const ENUM x) { return *this; }; virtual void foo2() { }; virtual CLASS& __cdecl operator<<(const char* x) { return *this; }; virtual CLASS& __cdecl operator<<(int x) { return *this; };

How would one transfer files larger than 2,147,483,646 bytes (~2 GiB) with Win32 TransmitFile()?

丶灬走出姿态 提交于 2021-02-04 19:08:53
问题 Quoted from MSDN entry for TransmitFile: The maximum number of bytes that can be transmitted using a single call to the TransmitFile function is 2,147,483,646, the maximum value for a 32-bit integer minus 1. The maximum number of bytes to send in a single call includes any data sent before or after the file data pointed to by the lpTransmitBuffers parameter plus the value specified in the nNumberOfBytesToWrite parameter for the length of file data to send. If an application needs to transmit

How would one transfer files larger than 2,147,483,646 bytes (~2 GiB) with Win32 TransmitFile()?

血红的双手。 提交于 2021-02-04 19:08:43
问题 Quoted from MSDN entry for TransmitFile: The maximum number of bytes that can be transmitted using a single call to the TransmitFile function is 2,147,483,646, the maximum value for a 32-bit integer minus 1. The maximum number of bytes to send in a single call includes any data sent before or after the file data pointed to by the lpTransmitBuffers parameter plus the value specified in the nNumberOfBytesToWrite parameter for the length of file data to send. If an application needs to transmit