问题产生应用程序

发布于 2024-09-30 04:06:38 字数 1125 浏览 4 评论 0原文

天哪,这太奇怪了,我不知道该说什么。简而言之,我有一个模拟器应用程序,当用户要求我时,我会从我的应用程序中生成该应用程序。它最近停止工作,尽管我可以从命令行或“开始”菜单正常运行模拟器。这可能是由于迁移到 VS2010 或 Windows 7 或我在查看源代码控制差异时没有注意到的原因。

我有第二个模拟器,我尝试以相同的方式生成它,它工作得很好。

默认情况下,我使用 Qt3 的 QProcess 包装器来实现此目的,但我使用系统、我自己的 CreateProcess 和 ShellExecute 也得到了相同的行为。

然而,cmd.exe“/c application params”的 ShellExecute 确实为我提供了更多信息。我收到对话框

“该程序无法启动,因为您的计算机缺少 MSVCR80.dll。请尝试重新安装该程序以解决此问题。”

不方便的是,父应用程序和第二个模拟器都使用 MSVCR80.dll。

将 MSVC*80.dll 从 g:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5 复制到与我的可执行文件相同的目录时,错误消息更改为

“运行时错误!
程序:g:\path\to\app.exe
R6034
应用程序尝试错误地加载 C 运行时库。
请联系应用程序的支持团队以获取更多信息。

其次是

应用程序无法正确启动(0xc0000142)。单击“确定”关闭应用程序。

而且,应用程序再次可以在这些 dll 就位的情况下从命令行正常运行。


更新:

我怀疑这可能与环境有关,因此更改了我的 ShellExecute 机制来执行 cmd /c set &&应用程序参数。我使用相同的参数设置了 cmd.exe,我的应用程序现在也同样崩溃了。当我弄清楚原因时会更新:)

这是 MATLAB 的组件运行时工具正在修改我的进程的 PATH 变量,从而产生不良影响。它在自己的目录中添加了大量的 dll,造成了严重破坏。

Gosh, this is so weird, I don't know what to say. The short version is that I have a simulator app which I spawn from my application when the user asks me to. It recently stopped working, though I can run the simulator fine from the command line or Start menu. This could be due to moving to VS2010 or Windows 7 or something I didn't notice reviewing source control diffs.

I have a second simulator which I try to spawn in the same fashion and it works fine.

By default, I'm using Qt3's QProcess wrapper around CreateProcess for this purpose, but I get the same behavior using system, my own CreateProcess, and ShellExecute.

ShellExecute of a cmd.exe "/c application params" does provide me with some more information however. I get the dialog

"The program can't start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem."

Inconveniently, both the parent application and the second simulator use MSVCR80.dll.

Upon copying MSVC*80.dll from g:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5 to the same directory as my executable, the error message changes to

"Runtime Error!
Program: g:\path\to\app.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.

Followed by

The application was unable to start correctly (0xc0000142). Click OK to close the application.

And, once again, the application runs fine from the command line with those dlls in place.


Update:

I suspected perhaps it was environment related, so changed my ShellExecute mechanism to do cmd /c set && app params. I set up a cmd.exe with those same params and my app is now crashing similarly. Will update when I figure out why :)

It is MATLAB's component runtime tool that is modifying my process's PATH variable to bad effect. It is prepending its own dir full of dll's and wreaking havoc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

ヅ她的身影、若隐若现 2024-10-07 04:06:38

我使用的一个愚蠢的工具在 PATH 上做了一个 setenv,在前面添加了一个它想要动态加载一些 dll 的目录,但这后来弄乱了我的应用程序。我最终使用了 GetEnvironmentStrings,如上一个示例此处所示,删除了PATH 环境变量中的第一个条目,并将新的(原始)环境发送到包装 CreateProcessA 的 QProcess。

A foolish tool I was using did a setenv on PATH, prepending a directory it wanted for dynamically loading some dlls, but which messed up my application later. I ended up using GetEnvironmentStrings as shown in the last example here, erasing the first entry in the PATH env var, and sending the new (original) environment to QProcess, which wraps CreateProcessA.

墨小沫ゞ 2024-10-07 04:06:38

您需要安装 CRT

You need to install the CRT

‖放下 2024-10-07 04:06:38

可能有效 - 如果它坏了,你可以保留两部分:-)

尝试从这里安装 VC++ 可再发行组件 - http://www.microsoft.com/downloads/en/details.aspx?familyid=A5C84275-3B97- 4AB7-A40D-3802B2AF5FC2&displaylang=en

请记住在安装东西之前备份您的系统,创建一个还原点等。

另一个想法 - 尝试重新安装失败的应用程序本身。它可能带有自己的 VC++ 可再发行版本,重新安装可能会有所帮助。特别是。尝试使用 Windows 7 的兼容模式重新安装(也许返回到 Vista 或 XP 兼容性)可能会更有效。

重申一下 - 你必须尝试,我不知道上述任何一个想法是否会对你有好处,或者甚至确保不会造成伤害。也就是说,如果我遇到类似的问题,这些是我会尝试的步骤。哈!

This may work - if it breaks, you get to keep both pieces :-)

Try installing VC++ redistributable from here - http://www.microsoft.com/downloads/en/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en.

Remember to backup your system, create a restore point etc. before installing stuff.

Another idea -try reinstalling the failing appliacation itself. It may come with its own copy of VC++ redistributables, and reinstalling might help. Esp. trying to reinstall it using Windows 7's compability mode (perhaps go back to Vista or XP compatibility) might be even more effective.

To reiterate - you'll have to try, and I've no real idea if either of the above ideas will do you good, or even be sure to do no harm. That said, if I were faced with a similar problem, these are the steps I'd try. HTH!

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