Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML

霸气de小男生 提交于 2019-12-04 09:53:11

If you peek into the source for DynaLoader you'll find

Many dynamic extension loading problems will appear to come from this section of code: XYZ failed at line 123 of DynaLoader.pm. Often these errors are actually occurring in the initialisation C code of the extension XS file. Perl reports the error as being in this perl code simply because this was the last perl code it executed.

You should have also gotten (but may not have noticed) the following dialog, which provides a more accurate error message:

The problem isn't that perl can't find LibXML.dll; it's that LibXML.dll can't find the real libxml. (The former is just a wrapper that provides Perl bindings for the latter.) To fix that you need to ensure that Strawberry Perl's c\bin folder is in your PATH. In your case, that would be C:\strawberry\c\bin.

You might have to check the environment variable settings in the windows, make sure that the installation path of the module is present in the PATH variable. The reason it works in linux is that make files usually set the environment variables for you in linux in windows it may not have set properly. For eg; go to Control Panel\System and Security\System click change settings then advanced tab in user variable section see if there is a variable called perl5lib. if not create an new perl5lib variable and add the path of your library ( usuall C:\Perl\site\lib but may be different in your case)

I had the same issue after installing Strawberry perl. It was working fine when I run the script from server, but not remotely from a automation tool. The issue was because of the Environment variables not updated when we run it remotely. So I did server reboot, which resolved the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!