CRT 未初始化
我正在尝试使用 MSVC 2010 编译一个项目,编译没问题,但是当我尝试运行该应用程序时,它给了我 CRT 未初始化错误。它是一个控制台应用程序,因此我尝试将 mainCRTStartup 指定为入口点,但没有帮助。 在同一个解决方案中还有其他项目,并且他们没有这样的问题。我发现它们之间的区别是,一个不起作用的,使用升压。如果这很重要,请升级 v1.38.0。运行时库是多线程DLL。
链接器命令行是:
/OUT:"D:\temp\ghost\Release\ghost.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\zlib\lib" /LIBPATH:"..\mysql\lib\opt" /LIBPATH:"..\boost\lib" "ws2_32.lib" "winmm.lib" "zdll.lib" "StormLibRAS.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "D:\temp\ghost\bncsutil\vc8_build\Release\BNCSutil.lib" /MANIFEST /ManifestFile:"Release\ghost.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\temp\ghost\Release\ghost.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:"D:\temp\ghost\Release\ghost.pgd" /LTCG /TLBID:1 /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
I'm trying to compile one project with MSVC 2010, compilation is ok, but when I try to run the app, it gives me CRT not initialized error. It is a console application, so I tried to specify mainCRTStartup as Entry Point, but it didn't help.
In the same solution there are other projects, and they don't have such a problem. The difference which I see between them is that one which is not working, uses boost. Boost v1.38.0 if this is important. Runtime Library is Multi-threaded DLL.
Linker command line is:
/OUT:"D:\temp\ghost\Release\ghost.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\zlib\lib" /LIBPATH:"..\mysql\lib\opt" /LIBPATH:"..\boost\lib" "ws2_32.lib" "winmm.lib" "zdll.lib" "StormLibRAS.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "D:\temp\ghost\bncsutil\vc8_build\Release\BNCSutil.lib" /MANIFEST /ManifestFile:"Release\ghost.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\temp\ghost\Release\ghost.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:"D:\temp\ghost\Release\ghost.pgd" /LTCG /TLBID:1 /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否使用
/DBOOST_THREAD_USE_DLL /DBOOST_ALL_DYN_LINK
设置进行编译?如果 Boost 认为您正在使用静态链接的 CRT 并且您正在使用 MT DLL,则可能会导致此类问题。
还要记住清理和重建。
Are you compiling with
/DBOOST_THREAD_USE_DLL /DBOOST_ALL_DYN_LINK
set?If Boost thinks you are using statically linked CRT and you are using MT DLL this could cause this type of issue.
Also remember to clean and rebuild.
对我来说,这非常简单:Spy++ 已打开,因此关闭 Spy++ 即可解决问题!
For me, this was very simple: Spy++ was open, so shutdown Spy++ solves the problem!
我认为你应该在启动之前将 PATH 设置为 boost/lib ,以便它可以找到 boost 库。
I think you should set your PATH to boost/lib before launching so that it can find the boost library.