开发者

windows 7 64 bits incorrect PATH when loading 32 bits library for 32 bits exe

I have an exe which depends on libeay32.dll. Both compiled for 32 bits.

I have copied the exe to C:\Program files (x86)\app\bin and the dll to C:\Program files (x86)\app\lib. To ensure the correct working, i have added C:\Program files (x86)\app\lib to the path.

On Windows 7 64 bits, when i execute the exe, i got a libeay32.dll not found error.

Using dependency walker for 32 bits, the library is properly located at C:\Program files (x86)\app\lib. Using sysinternal process explorer the app is executed properly. Using cmd also works. Using dependency walker for 64 bits, i can see the missing libraries. Copying the two files toghether or dll to syswow64 also works perfectly.

If the application was compiled for 32 bits...

Why isnt windows looking for 32 bits libraries? Why arent the libraries resolved if directory is开发者_运维知识库 already on path?

My guess is that w7 is ignoring the path, but according to this: http://msdn.microsoft.com/en-us/library/ms682586%28v=vs.85%29.aspx it shouldnt!.

Why i cant run my exe with dependencies located on path? Should i register the library or something?

Any ideas will be much appreciated.

EDIT:

The program its correctly launched/executed when done from start menu->program, but not directly on the .exe...wtf?

Using procmon seems to be trying to open (note the lack of " "): "C:\Program Files(x86)\myapp\Third-Party\openssl\LIBEAY32.dll" but in the path its correct (rechecked: "C:\Program Files (x86)\myapp\Third-Party\openssl")

ANSWER?: is there a know scenario/bug where setting "C:\Program Files (x86)" on path, lead windows try to load "C:\Program Files(x86)" instead????(see using procmon without ANY filter)

Windows 7 x64 bug?


You can mvoe the lib into the same directory, because there it always checks first. If its found, it is used. On Windows 64 bit systems you can (not tried) also move the libs to the SystemWOW64 folder where the 32bit versions are stored, but I would recommend the first version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜