gpt4 book ai didi

c - Axis2 加载 DLL 失败

转载 作者:行者123 更新时间:2023-12-04 22:49:44 25 4
gpt4 key购买 nike

我在 Apache-Axis2 日志文件中看到了以下行。

[Sat Nov 14 12:16:08 2015] [error] ..\..\util\src\class_loader.c(167) Loading shared library ..//lib/axis2_http_sender.dll  Failed. DLERROR IS DLL Load Error 126: The specified module could not be found.

从第 156 行到第 167 行分析 class_loader.c 文件,如下所示:

dll_name = axutil_dll_desc_get_name(dll_desc, env);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Shared library to be loaded is %s",dll_name);
dl_handler = AXIS2_PLATFORM_LOADLIB(dll_name);
if (!dl_handler)
{
#ifndef WIN32
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Loading shared library %s Failed. DLERROR IS %s",
dll_name, AXIS2_PLATFORM_LOADLIB_ERROR);
#else
axis2_char_t buff[AXUTIL_WIN32_ERROR_BUFSIZE];
axutil_win32_get_last_error(buff, AXUTIL_WIN32_ERROR_BUFSIZE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Loading shared library %s Failed. DLERROR IS %s",dll_name, buff);

我想问题出在第一行 - dll_name = axutil_dll_desc_get_name(dll_desc, env);dll_name中存储的值是..//lib/axis2_http_sender.dll。虽然存在 axis2_http_sender.dll在相对于可执行文件的 lib 目录中,链接器无法连接到它。

我从未见过像下面这样的文件名语法:

..//lib/axis2_http_sender.dll

我在 Windows 命令行 中对其进行了测试,它的工作方式如下:

../lib/axis2_http_sender.dll

C 中使用连续的 / 意味着什么功能类似于 fopen()?

我确实尝试了一些代码示例。

下面是一段C代码:

FILE *fp;
fopen_s(&fp,"C://tempfile.txt", "w");
fputs("Text content", fp);
fclose(fp);

上面的代码对我来说效果很好。

最佳答案

终于破解了这个。
CSDN博文建议 Axis2C Windows 分发依赖于 OpenSSL DLL。

我使用以下命令列出了 axis2_apache_server.exe 的 dll 依赖项。

listdlls axis2_apache_server.exe

并且列表显示运行它需要两个 ssl dll libeay32ssleay32。但是,Axis2 二进制分发版中缺少这两个 dll。

(我不知道为什么,我认为它应该包含在内。而且 Axis2 文档中没有提到这一点。)

以上 dll 在 Apache2OpenSSL 安装中可用,我将这些 dll 的路径添加到我的 PATH 变量中。

我运行了 axis2_apache_server.exe,瞧!

结论:文件路径中连续的/根本不影响链接。

寓意:当遇到dll加载错误时,应该首先检查exe文件的dll依赖关系,确保所有dll都存在。

虽然道德很难学!!

关于c - Axis2 加载 DLL 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33706609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com