program.exe:Native'已退出,代码为255(0xff) [英] program.exe: Native' has exited with code 255 (0xff)
问题描述
我使用boost线程,一切工作完美的编译/ MD,但我真的更喜欢用/ MT代替
I am using boost threads, and everything works perfectly when compiling with /MD but I really prefer compiling with /MT instead
然后我得到的问题是程序。
The problem I then get is program.exe: Native' has exited with code 255 (0xff).
这发生在这一行:
thread_1 = thread(testThread,test);
thread_1 = thread(testThread,test);
在深入挖掘之后,我意识到问题是_crtheap等于0,即它没有初始化。
after digging down deeper, I realised the problem is the fact that _crtheap equals to 0, ie: it's not initialized.
如mlock.c中所示
as seen in 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) */
}
但是对于我的生活,我无法弄清楚如何解决它
so now I know what the problem is, but for the life of me I can't figure out how to fix it
boost是这样构建的(对于这个特定的编译,它提供了.lib的msvc ++请求)
boost is built like this (for this particular compile, which gives the .lib's msvc++ asks for)
bjam toolset=msvc-10.0 variant=debug threading=multi link=static runtime-link=static
推荐答案
看起来像CRTs之间的经典组合hiccup:
Seems to me as a classic mix between CRTs hiccup :
- boost库与静态调试CRT(使用所谓的/ MD开关)链接
- (使用所谓的/ MT开关)
请尝试使用此配方重新编译boost库
Please try recompiling the boost library using this recipe
bjam toolset=msvc-10.0 variant=release threading=multi link=static runtime-link=static
这篇关于program.exe:Native'已退出,代码为255(0xff)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!