Skip to content

Instantly share code, notes, and snippets.

@danielsource
Created December 23, 2024 20:44
Show Gist options
  • Save danielsource/91965bae5c1285aa7355005a42108c13 to your computer and use it in GitHub Desktop.
Save danielsource/91965bae5c1285aa7355005a42108c13 to your computer and use it in GitHub Desktop.
win32_hello
:: Build script.
@echo off
setlocal
set VSLANG=1033
set flags=/nologo /std:c++14 /Zi /W4 /wd4100
if not exist win32_precomp.pch (
cl %flags% /Yc"win32_precomp.hpp" /c win32_precomp.cpp
)
cl %flags% /Fe"hello.exe" /Yu"win32_precomp.hpp" win32_hello.cpp /link win32_precomp.obj user32.lib
endlocal
#include "win32_precomp.hpp"
int WINAPI
WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR lpCmdLine,
int nCmdShow)
{
int i = 42;
char s[3];
s[0] = (char)(i / 10) + '0';
s[1] = (char)(i % 10) + '0';
s[2] = '\0';
OutputDebugStringA(s);
return 0;
}
#include "win32_precomp.hpp"
/* Precompiled header. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment