Unable to compile basic program in Visual Studio Community 2015 (LNK2019 - MSVCRTD.lib)
<p>I installed Visual Studio Community 2015 on a fairly fresh Win10 install that never had any IDEs/dev tools installed on it.</p>
<p>I made an empty c++ project, added <code>main.cpp</code>, set the entry point to <code>main</code> and added:</p>
<pre><code>void main()
{

}
</code></pre>
<p>On <code>VS2013</code> I could do this without any issues. I am getting linker errors with this that I haven't been able to figure out:</p>
<pre><code>Severity    Code    Description File    Line
Error   LNK2019 unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_init_.obj) 1
Error   LNK2019 unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_init_.obj) 1
Error   LNK2019 unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_error_.obj)    1
Error   LNK2019 unresolved external symbol __wmakepath_s referenced in function &quot;int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)&quot; (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol __wsplitpath_s referenced in function &quot;int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)&quot; (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol _wcscpy_s referenced in function &quot;int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)&quot; (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function &quot;struct HINSTANCE__ * __cdecl GetPdbDll(void)&quot; (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol ___vcrt_GetModuleHandleW referenced in function &quot;struct HINSTANCE__ * __cdecl GetPdbDll(void)&quot; (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol ___vcrt_LoadLibraryExW referenced in function &quot;struct HINSTANCE__ * __cdecl GetPdbDll(void)&quot; (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj)  1
Error   LNK2019 unresolved external symbol __except_handler4_common referenced in function __except_handler4    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_chandler4gs_.obj)  1
Error   LNK1120 10 unresolved externals C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\Debug\ConsoleApplication1.exe   1
</code></pre>
<hr />
<p><strong>Update:</strong></p>
<p>I changed two configuration properties:</p>
<ul>
<li><kbd>Linker</kbd> &gt; <kbd>Input</kbd> &gt; <kbd>Ignore All Default Libraries</kbd> &gt; <code>Yes (/NODEFAULTLIB)</code></li>
<li><kbd>C/C++</kbd> &gt; <kbd>Code Generation</kbd> &gt; <kbd>Basic Runtime Checks</kbd> &gt; <code>Default</code></li>
</ul>
<p>This let me build the above code however after adding some other trivial code, I am getting a slew of other issues:</p>
<pre><code>#include &lt;string&gt;

using namespace std;

void main()
{
    string blah = &quot;string&quot;;
}
</code></pre>
<p>It should be trivial to include a standard library and yet:</p>
<pre><code>Severity    Code    Description File    Line
Error   LNK2019 unresolved external symbol &quot;void * __cdecl operator new(unsigned int)&quot; (??2@YAPAXI@Z) referenced in function &quot;void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)&quot; (?_Allocate@std@@YAPAXII_N@Z)  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;void __cdecl operator delete(void *)&quot; (??3@YAXPAX@Z) referenced in function &quot;void __cdecl std::_Deallocate(void *,unsigned int,unsigned int)&quot; (?_Deallocate@std@@YAXPAXII@Z)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol __imp___invalid_parameter referenced in function &quot;void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)&quot; (?_Allocate@std@@YAPAXII_N@Z)   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) public: __thiscall std::_Lockit::_Lockit(int)&quot; (__imp_??0_Lockit@std@@QAE@H@Z) referenced in function &quot;public: void __thiscall std::_Container_base12::_Orphan_all(void)&quot; (?_Orphan_all@_Container_base12@std@@QAEXXZ)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) public: __thiscall std::_Lockit::~_Lockit(void)&quot; (__imp_??1_Lockit@std@@QAE@XZ) referenced in function &quot;public: void __thiscall std::_Container_base12::_Orphan_all(void)&quot; (?_Orphan_all@_Container_base12@std@@QAEXXZ)   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol _memcpy referenced in function &quot;public: static char * __cdecl std::char_traits&lt;char&gt;::copy(char *,char const *,unsigned int)&quot; (?copy@?$char_traits@D@std@@SAPADPADPBDI@Z)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol __imp__memmove referenced in function &quot;public: static char * __cdecl std::char_traits&lt;char&gt;::move(char *,char const *,unsigned int)&quot; (?move@?$char_traits@D@std@@SAPADPADPBDI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol _strlen referenced in function &quot;public: static unsigned int __cdecl std::char_traits&lt;char&gt;::length(char const *)&quot; (?length@?$char_traits@D@std@@SAIPBD@Z)    C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol __imp___CrtDbgReportW referenced in function &quot;void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)&quot; (?_Allocate@std@@YAPAXII_N@Z)   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)&quot; (__imp_?_Debug_message@std@@YAXPB_W0I@Z) referenced in function &quot;void __cdecl std::_Debug_pointer&lt;char const &gt;(char const *,wchar_t const *,unsigned int)&quot; (??$_Debug_pointer@$$CBD@std@@YAXPBDPB_WI@Z)   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) void __cdecl std::_Xbad_alloc(void)&quot; (__imp_?_Xbad_alloc@std@@YAXXZ) referenced in function &quot;void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)&quot; (?_Allocate@std@@YAPAXII_N@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)&quot; (__imp_?_Xlength_error@std@@YAXPBD@Z) referenced in function &quot;public: void __thiscall std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;::_Xlen(void)const &quot; (?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ)  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol &quot;__declspec(dllimport) void __cdecl std::_Xout_of_range(char const *)&quot; (__imp_?_Xout_of_range@std@@YAXPBD@Z) referenced in function &quot;public: void __thiscall std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;::_Xran(void)const &quot; (?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ)  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol @__security_check_cookie@4 referenced in function __unwindfunclet$??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z$0  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol __CxxThrowException@8 referenced in function __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$1  C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z$0 C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2019 unresolved external symbol ___security_cookie referenced in function &quot;public: __thiscall std::_String_alloc&lt;struct std::_String_base_types&lt;char,class std::allocator&lt;char&gt; &gt; &gt;::_String_alloc&lt;struct std::_String_base_types&lt;char,class std::allocator&lt;char&gt; &gt; &gt;(class std::allocator&lt;char&gt; const &amp;)&quot; (??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj    1
Error   LNK2001 unresolved external symbol __load_config_used   C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\LINK    1
Error   LNK1120 18 unresolved externals C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\Debug\ConsoleApplication1.exe   1
</code></pre>