2012-10-31 39 views
2

我写了一个C程序,并在Windows 7和Linux工作正常,但是当我执行它在Windows XP中我得到的错误:错误与MSVCRT.DLL和PCRE库

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

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

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

这里是什么取决于沃克告诉我的图像:

enter image description here

+2

是安装在XP的机器上相应的VC-运行时可再发行?在Win7上运行的VC运行时间比WinXP上的要高出三代(甚至是SP2)。 – WhozCraig

+1

嗨,如果你的问题现在已经被下面的答案解决了,请点击答案旁边的勾号。否则,请提供您自己的问题答案并将其标为正确答案。 – Chris

回答

3

原因的可能性(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.

根据是什么原因, 这里是解决一些想法:

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)

Rebuildi NG:

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?

回答根据的猜测和Jeffrey Tan research here

research here

+0

谢谢你,这似乎是我的问题,我现在就试试看,并告诉你它是否有效,顺便说一下,我使用dev C++(gcc) – tiagoMissiato

+0

I1m对不起,但我不明白ID“据说(通过互联网)PCRE3.DLL属于”GnuWin32非系统进程“,这意味着你可以尝试找到它并重命名/删除它”,你的意思是删除pcre3.dll?如果是的话,我不能因为我需要使用正则expretion(pcre3.dll) – tiagoMissiato

0

(代表OP的)

的问题是与pcre3.dll,为I”我之前告诉过,我只是改变了它的版本,我使用的版本是7.x,并改为4.4,它调用pcre.dll而不是pcre3.dll,如果任何人有同样的问题,这解决了我的问题。

这里是链接到正确的lib: pcre-4.4-dll.zip