tiagoMissiato
tiagoMissiato

Reputation: 335

Error with msvcrt.dll and pcre library

I wrote a C program and works fine on Windows 7 and Linux, but when I execute it on Windows XP I get the error:

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

I researched it and some people said to delete the DLL "dwmapi.dll" which I don't have, so that's not my problem.

Some one told me to use depends walker(depends.exe) to find who is using msvcrt.dll. I did and find that pcre library is using it and there actually is a problem with it, but I don't have any idea how to solve this. Can any one help me?

Here's image of what depends walker show me:

enter image description here

Upvotes: 2

Views: 3203

Answers (2)

Himanshu
Himanshu

Reputation: 32602

(On behalf of OP)

The problem was with the pcre3.dll, as i've told before, and i simply change the version of it, I was using the version 7.x and change to 4.4 that calls pcre.dll instead of pcre3.dll, that solve my problem if any one have the same issue.

here is the link to the correct lib: pcre-4.4-dll.zip

Upvotes: 0

variable
variable

Reputation: 59

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:

Upvotes: 3

Related Questions