嵌入式 Python 应用程序中的运行时错误 R6034 [英] Runtime error R6034 in embedded Python application

查看:32
本文介绍了嵌入式 Python 应用程序中的运行时错误 R6034的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用 Boost.Python 嵌入 Python 解释器的应用程序.这用于运行与主程序交互的用户生成的脚本".

I am working on an application which uses Boost.Python to embed the Python interpreter. This is used to run user-generated "scripts" which interact with the main program.

不幸的是,一位用户在尝试运行脚本时报告了运行时错误 R6034.主程序启动正常,但我认为问题可能是在加载python27.dll时出现的.

Unfortunately, one user is reporting runtime error R6034 when he tries to run a script. The main program starts up fine, but I think the problem may be occurring when python27.dll is loaded.

我使用的是 Visual Studio 2005、Python 2.7 和 Boost.Python 1.46.1.该问题仅发生在一个用户的机器上.我之前处理过明显的问题,并设法解决了它们,但在这种情况下,我有点不知所措.

I am using Visual Studio 2005, Python 2.7, and Boost.Python 1.46.1. The problem occurs only on one user's machine. I've dealt with manifest issues before, and managed to resolve them, but in this case I'm at a bit of a loss.

有没有其他人遇到过类似的问题?你能解决吗?怎么样?

Has anyone else run into a similar problem? Were you able to solve it? How?

推荐答案

我找到了问题的解决方案.希望这会对其他人有所帮助——这些问题可能会令人沮丧地调试.

I found the solution to the problem. Hopefully this will help someone else--these problems can be so frustrating to debug.

该问题是由将自身添加到路径中并在其程序文件夹中安装 msvcr90.dll 的第三方软件引起的.在这种情况下,问题是由英特尔的 iCLS 客户端引起的.

The problem was caused by third-party software that had added itself to the path and installed msvcr90.dll in its program folder. In this case, the problem was caused by Intel's iCLS Client.

那么...如何在类似情况下找到问题?

So... How to find the problem in similar situations?

  1. 此处下载流程浏览器.

启动您的应用程序并重现运行时错误 R6034.

Start your application and reproduce runtime error R6034.

启动进程浏览器.在视图"菜单中,转到下窗格视图"并选择DLL".

Start Process Explorer. In the "View" menu go to "Lower Pane View" and choose "DLLs".

在顶部窗格中,找到您的应用程序并单击它.底部窗格应显示为您的应用程序加载的 DLLS 列表.

In the top pane, locate your application and click on it. The bottom pane should show a list of DLLS loaded for your application.

在列表中找到msvcr??.dll".应该有几个.查找不在winsxs"文件夹中的那个,并记下它.

Locate "msvcr??.dll" in the list. There should be several. Look for the one that is not in the "winsxs" folder, and make a note of it.

现在,在您的应用程序运行之前检查路径.如果它包含您在第 5 步中记下的文件夹,您可能已经找到了罪魁祸首.

Now, check the path just before your application runs. If it includes the folder you noted in step 5, you've probably found the culprit.

如何解决问题?在运行程序之前,您必须从路径中删除有问题的条目.就我而言,路径中不需要任何其他内容,因此我编写了一个简单的批处理文件,如下所示:

How to fix the problem? You'll have to remove the offending entry from the path before running your program. In my case, I don't need anything else in the path, so I wrote a simple batch file that looks like this:

path=
myprogram.exe

就是这样.批处理文件只是在我的程序运行之前清除路径,这样就找不到冲突的运行时 DLL.

That's it. The batch file simply clears the path before my program runs, so that the conflicting runtime DLL is not found.

希望这有帮助!

这篇关于嵌入式 Python 应用程序中的运行时错误 R6034的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆