With msvcrt.lib/msvcrt.dll it is possible to make small executable too.int printf(const char * restrict format, ...);
void exit(int status);
#pragma comment(lib, "msvcrt.lib")
void __cdecl mainCRTStartup(void)
{
printf("Hello World\n");
exit(0);
}
#pragma comment (lib, "msvcrt.lib")
//#pragma comment(linker,"/merge:.rdata=.data")
#pragma comment(linker,"/subsystem:console,5.1") // for ms link 10
int __cdecl printf(const char *format, ...);
void __cdecl mainCRTStartup(void)
{
int __cdecl main(int argc, char **argv);
int __cdecl __getmainargs(int*, char***, char***, int, void*);
void __cdecl exit(int status);
int argc;
char** argv;
char** env;
int si = 0; // XP needs this
__getmainargs(&argc,&argv,&env,0,&si);
exit(main(argc,argv));
}
int main(int argc, char **argv)
{
printf("Hello C\n");
return 0;
}