VS2015 C++ static initialization crash, possible bug

后端 未结 1 1731
有刺的猬
有刺的猬 2021-01-15 09:55

I\'m seeing something weird happening with Visual Studio 2015 Community. Code that worked perfectly in VS2012 crashes at startup when ported to VS2015, before main is invoke

相关标签:
1条回答
  • 2021-01-15 10:38

    Well, @bogdan got it right. My project had a mix of settings that was neither /SUBSYSTEM:CONSOLE nor /SUBSYSTEM:WINDOWS. Once I fixed that, everything started to work as expected. My test projects had the same problem, I blame Microsoft for not having a clear "CLR windows app" C++ template any more in VS2015 (they want to push you to use C# for that, which makes sense most of the times, but not always).

    I found this page particularly useful in explaining all the different settings that have to be consistent (it's not just /SUBSYSTEM...).

    I wish I could mark @bogdan's comment as answer, but I can't see anything to do that.

    Thanks Bogdan!

    0 讨论(0)
提交回复
热议问题