My solution built yesterday. Today after changing nothing but .hpp and .cpp files it doesn't.
The full error text from Visual Studio 2013 (Using the November 2013 CTP):
Error 1 error LNK2005: __xi_a already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game
Error 2 error LNK2005: __xi_z already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game
Error 3 error LNK2005: __xc_a already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game
Error 4 error LNK2005: __xc_z already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game
Error 7 error LNK1169: one or more multiply defined symbols found C:\Users\drtwox\dev\repos\game\trunk\engine\build\x64\Test\game.exe 1 1 game
About as useful as a poke in the eye...
This answer to this similar question says:
You are mixing code that was compiled with /MD (use DLL version of CRT) with code that was compiled with /MT (use static CRT library). That cannot work, all source code files must be compiled with the same setting. Given that you use libraries that were pre-compiled with /MD, almost always the correct setting, you must compile your own code with this setting as well.
I have checked (and rechecked) that all projects in the solution are still using the same runtime library; Multi-threaded DLL
for Release and Multi-threaded Debug DLL
for Debug. I've done a full solution rebuild just to be sure.
The Subversion log shows the 'external' directory that contains all 3rd party libraries had not been modified since 2013-12-04; one month ago. I checked their configurations and rebuilt them anyway.
The Subversion log also shows that only existing .hpp and .cpp files have been modified since yesterday. No new libraries have been added, no new external headers #included and no project configurations have changed. There are over 200 lines of changed and new code in 7 files.
What could be the problem?
Update: The log from the compiler: http://pastebin.com/aHJ5Xi2V
Solution: The problem was not incorrect /MT /MD compiler flags, it was the GLEW library and a missing #define GLEW_STATIC
. I changed the GLEW project settings to use /Zl (Omit Default Library Name) as documented here: http://msdn.microsoft.com/en-us/library/f1tbxcxh.aspx.