CRT 未初始化

发布于 2024-12-10 00:54:29 字数 1005 浏览 3 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一向肩并 2024-12-17 00:54:29

您是否使用 /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.

因为看清所以看轻 2024-12-17 00:54:29

对我来说,这非常简单:Spy++ 已打开,因此关闭 Spy++ 即可解决问题!

For me, this was very simple: Spy++ was open, so shutdown Spy++ solves the problem!

花开半夏魅人心 2024-12-17 00:54:29

我认为你应该在启动之前将 PATH 设置为 boost/lib ,以便它可以找到 boost 库。

I think you should set your PATH to boost/lib before launching so that it can find the boost library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文