Is there a way of compiling C/C++ with Visual Studio 2015 without using any runtime library?
I need to compile without a runtime library because I\'m creating my own run
To compile your app without C-Runtime Library (CRT) use /MT
, /NODEFAULTLIB
linker options and redefine entry point at Linker -> Advanced -> Entry Point
to function defined in your code, e.g. rawMain
. The signature is:
DWORD CALLBACK rawMain();
Without C-runtime library you are not allowed to use it's functions, like malloc
, free
, memset
, etc. You should implement all the used CRT functions by yourself. E.g. you can replace usage of malloc
by VirtualAlloc()
and free
by VirtualFree()
.
To check that C-runtime is not linked to your application use Dependency Walker.