[英]Windows 10 Visual Studio 2013 build error for Windows 8.1 project
Im getting an error when building a win8.1
project on Windows 10
using VS2013 我在使用VS2013在Windows 10
上构建win8.1
项目时收到错误
'RAIG3D.Windows.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mswsock.dll'. Symbols loaded.
Debug Assertion Failed!
Program: ...win8.1-universal\Debug\RAIG3D.Windows\AppX\RAIG3D.Windows.exe
File: f:\dd\vctools\crt\crtw32\misc\dbgheap.c
Line: 1424
Expression: _pFirstBlock == pHead
Im using winsock2.h
in a .dll
thats linked to the project. 我在链接到该项目的.dll
使用winsock2.h
。 Its a custom network library im trying to write. 它是一个试图编写的自定义网络库。 Its on the windows
branch 它在windows
分支上
https://github.com/damorton/libsocket/tree/windows https://github.com/damorton/libsocket/tree/windows
This library works for win32 debug programs fine, but for win8.1 its giving the above error 该库适用于win32调试程序,但适用于win8.1,给出上述错误
This is not a build error, it's a run-time error. 这不是构建错误,而是运行时错误。 Specifically, an assertion has fired. 具体来说,一个断言已经被触发。 This is what the message is telling you: 这是该消息告诉您的内容:
Debug Assertion Failed! 调试断言失败!
A piece of code has just executed that uses some variant of an assert
macro to catch possible bugs. 刚刚执行的一段代码使用了assert
宏的某些变体来捕获可能的错误。 It caught one. 它抓住了一个。 Which is nice. 很好 Even better, it tells you where that assert macro was fired: 更妙的是,它会告诉你哪里是断言宏被解雇:
Program: ...win8.1-universal\\Debug\\RAIG3D.Windows\\AppX\\RAIG3D.Windows.exe 程序:... win8.1-universal \\ Debug \\ RAIG3D.Windows \\ AppX \\ RAIG3D.Windows.exe
File: f:\\dd\\vctools\\crt\\crtw32\\misc\\dbgheap.c 文件:f:\\ dd \\ vctools \\ crt \\ crtw32 \\ misc \\ dbgheap.c
Line: 1424 线:1424
That's your program, but not your code file. 那是您的程序,而不是您的代码文件。 So it isn't an assertion that you wrote, it's one that the Microsoft developers put in their C run-time library routines. 因此,这不是您编写的断言,而是Microsoft开发人员在其C运行时库例程中添加的断言。 Specifically, in the dbgheap.c
file, which suggests that it has something to do with the debug heap, which is used to allocate memory in debugging builds. 具体地说,在dbgheap.c
文件中,这表明它与调试堆有关,该调试堆用于在调试版本中分配内存。
The message also tells you what the expression was that turned out to be unexpectedly false and therefore triggered the assert: 该消息还告诉您表达式的内容原来是错误的,因此触发了断言:
Expression: _pFirstBlock == pHead 表达式:_pFirstBlock == pHead
Looks like two pointers that were supposed to be equal were actually not equal. 看起来两个应该相等的指针实际上并不相等。
If you had pressed the "Retry" button on the message box that popped up, you would have been able to break into the code with the debugger and see the offending line of code in context. 如果您按了弹出的消息框中的“重试”按钮,则可以使用调试器插入代码,并在上下文中查看有问题的代码行。 You also would have had a full call stack to look at. 您还需要查看完整的调用堆栈。
The call stack would have been helpful to see which line of your code was executing before you called into library code that fired this assertion. 调用堆栈将是有益的,看看你的代码的行正在执行你叫库代码触发此断言之前。 This assertion is an internal consistency check that the CRT authors put in their memory allocation routines. 此断言是CRT作者放入其内存分配例程中的内部一致性检查。 If you're triggering it, you're doing something badly wrong inside of your application. 如果触发它,则说明您的应用程序内部存在严重错误。
If I were to hazard a guess, without having any more information available to me than I do, I'd guess that you were probably trying to mix executables and libraries that reference different versions of the CRT. 如果我想冒险,而没有比我更多的可用信息,我想您可能正在尝试混合引用不同版本的CRT的可执行文件和库。 This is unsupported and likely to result in serious problems. 这不受支持,并可能导致严重的问题。 Different versions of the CRT have different object sizes, memory layouts, static variables, etc. You're lucky this time it was caught by an assertion. 不同版本的CRT具有不同的对象大小,内存布局,静态变量等。这次您很幸运,它被一个断言捕获。 Check that all of your projects are targeting the same version of the CRT, including the ones that generate DLLs and LIBs. 检查所有项目是否都针对相同版本的CRT,包括那些生成DLL和LIB的项目。 Do a full rebuild from scratch to ensure that they've all been updated. 从头开始全面重建,以确保它们都已更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.