Update: use PowerShell script PythonEmbed4Win.ps1.
The instructions in this gist have some subtle problems and this gist will not be updated.
This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.
Run py.exe portable-msvc.py
and it will download output into msvc
folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.
You can list available versions with py.exe portable-msvc.py --show-versions
and then pass versions you want with --msvc-version
and --sdk-version
arguments.
To use cl.exe/link.exe first run setup_TARGET.bat
- after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.
To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc
argument (msvc is folder name where output is stored).
#include <stdio.h> | |
#include <stdlib.h> | |
#include <uchar.h> | |
#include <locale.h> | |
#define __STD_UTF_16__ | |
//Pointer arrays must always include the array size, because pointers do not know about the size of the supposed array size. | |
void utf8_to_utf16(unsigned char* const utf8_str, int utf8_str_size, char16_t* utf16_str_output, int utf16_str_output_size) { | |
//First, grab the first byte of the UTF-8 string |
/*var getStackTrace = function () { | |
var obj = {}; | |
Error.captureStackTrace(obj, getStackTrace); | |
return obj.stack; | |
};*/ | |
function a0_0x2022(_0xcf00d8, _0x46623d) { | |
const _0xf90af8 = a0_0xf90a(); | |
return ( | |
(a0_0x2022 = function (_0x2022ef, _0xef2f2) { |
Update: use PowerShell script PythonEmbed4Win.ps1.
The instructions in this gist have some subtle problems and this gist will not be updated.