2
我使用升压线程,并用/ MD编译但我真的很喜欢使用/ MT代替的Program.exe:母语”已退出,代码为255(0xFF的)
的问题,那么我得到的编译时一切完美是program.exe:Native'已退出,代码为255(0xff)。
这发生在这条线:
thread_1 =螺纹(testThread,测试);
深入挖掘后,我意识到这个问题是_crtheap等于0的事实,即:它没有被初始化。
所看到的mlock.c
/*
* Check if CRT is initialized. The check if _crtheap is initialized
* will do the job. More over we had to add this test in initlocks because
* in debug version we don't endup calling lock before calling malloc_base,
* where we check for crtheap.
*/
if (_crtheap == 0) {
_FF_MSGBANNER(); /* write run-time error banner */
_NMSG_WRITE(_RT_CRT_NOTINIT); /* write message */
__crtExitProcess(255); /* normally _exit(255) */
}
所以现在我知道问题是什么,但对我的生活我无法弄清楚如何解决它
提升是建立像这(对于这个特殊的编译,这使的.lib的MSVC++请求)
bjam toolset=msvc-10.0 variant=debug threading=multi link=static runtime-link=static
请您提供一个完整的示例吗? – 2012-12-15 12:06:06