2

我编写了一个 C 程序并且在 Windows 7 和 Linux 上运行良好,但是当我在 Windows XP 上执行它时出现错误:

"_except_handler4_common could not be located in the dynamic link library msvcrt.dll"

我研究了一下,有人说要删除我没有的DLL“dwmapi.dll”,所以这不是我的问题。

有人告诉我使用它depends walker(depends.exe)来查找谁在使用msvcrt.dll. 我做了并发现该pcre库正在使用它,实际上它存在问题,但我不知道如何解决这个问题。谁能帮我?

这是取决于沃克向我展示的图像:

在此处输入图像描述

4

2 回答 2

3

Reason possibilities (afaiu):

a) You linked to msvcrt.dll specifically when building - this should not happen according to Microsoft support unless you specifically do it.

b) Some other installed or copied program/driver on your XP that links to "wrong" version of msvcrl.dll is being triggered.

Depending on what the reason is, here are few ideas to resolve:

1) There might be some program/driver/etc. installation on your XP machine that has introduced "Vista/Win7 related crap" onto it. It is said (by the internets) that PCRE3.DLL belongs to "GnuWin32 Non-system processes". That means you can try to find it and rename/delete it. Or delete the program you that uses it.

2) Installing the redist for XP of the C++ redistributable that you used to build on Win7 might help. This is link for VS2005: (darn.. use google - i can only give two links per post :P)

Rebuilding:

3) Just build the file from sources on your XP machine using some VisualStudio version you can get on it. And check those VS project properties!

4) Fix your build on Windows7. You might be linking to _except_handler4_common in msvcrt.dll in your Windows 7 build. Make sure that you do not do that. You can specifically instruct the linker not to link to it in VisualStudio project properties "/NODEFAULTLIB:msvcrt80.lib". You also did not specify what are you using for building. VS2005, VS2008, VS2010, gcc?

Answer based on educated guesses and Jeffrey Tan research here:

and research here:

于 2012-10-31T17:50:21.450 回答
0

(代表欧普)

问题出在 pcre3.dll 上,正如我之前所说,我只是更改了它的版本,我使用的是 7.x 版本并更改为调用 pcre.dll 而不是 pcre3.dll 的 4.4,这解决了我的问题,如果有人有同样的问题。

这是正确库的链接: pcre-4.4-dll.zip

于 2013-03-19T12:46:56.660 回答