程序输入点axiom_attribute_create不能设在动态链接库 [英] The procedure entry point axiom_attribute_create could not be located in the dynamic link library

查看:330
本文介绍了程序输入点axiom_attribute_create不能设在动态链接库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C项目,我想编译与MinGW的$ C $的cblock。
我试图联系其需要的库,但我得到了

I have a project in c and I want to compile it in CodeBlocks with MinGW. I tried to link its needed libraries but I got

未定义引用错误

所以我搜查,发现了,我用的库编译与MVC ++,不能使用MinGW使用。 (我不是在C方面的专家,所以我有点糊涂了。)我发现<一个href=\"https://www.daniweb.com/software-development/cpp/threads/260792/linker-error-undefined-reference-to-_imp__axutil_env_create_all#post1133608\"相对=nofollow>这个链接并没有他们所说的,为了解决我的问题。

so I searched and found out that the libraries that I was using was compiled with MVC++ and cannot be used with MinGW. (I am not an expert in c, so I'm a little bit confused.) I found This link and did what they said in order to solve my problem.

我已经从原来的AXIS2C .dll文件创建AXIS2C .a文件。

I have created axis2c .a files from the original axis2c .dll files.


  • 我创建的.def文件,reimp

  • 然后我在修改文件的.def每个STDCALL功能(我改变_name @序到名)

  • 然后我用dlltool创建.a文件。

我联系了.a文件到我的项目。一切都很好,我可以编译我的项目。但是当我尝试运行它。我得到这个错误。

I linked the .a files to my project. Everything went fine and I could compile my project. but when I try to run it. I get this error.

程序输入点axiom_attribute_create不能设在动态链接库

The procedure entry point axiom_attribute_create could not be located in the dynamic link library

我已经包含了我在这个链接项目。

I have included my project in this Link.

我下载了一个的MinGW $ C $的cblock。 $ C $个cblocks-10.05mingw-SETUP.EXE(我猜使用 MinGw32bit ),然后我跟着这@mikekinghan说的步骤来设置构建选项即可。然后,我建这个项目。我得到这个错误。
我已经添加AXIS2C lib文件夹到路径环境。 (我甚至复制axiom.dll到C:\\ WINDOWS \\ Syswow64资料为@mikekinghan建议

I downloaded a CodeBlocks with MinGW. codeblocks-10.05mingw-setup.exe (which I guess uses MinGw32bit).Then I followed the steps that @mikekinghan said to set up Build Options. Then I built the project. I got this error. I have already added Axis2c lib folder to path Environment. (I even copied axiom.dll to "C:\Windows\SysWOW64" as @mikekinghan suggested.

下面是生成日志:

-------------- Build: Debug in Math ---------------

mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperatorResponse.c -o obj\Debug\adb_addOperatorResponse.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\adb_addOperatorResponse.h:21,
                 from E:\dev\c\Math\adb_addOperatorResponse.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\adb_addOperatorResponse.c: In function 'adb_addOperatorResponse_serialize_obj':
E:\dev\c\Math\adb_addOperatorResponse.c:466: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
E:\dev\c\Math\adb_addOperatorResponse.c:374: warning: unused variable 'ns_already_defined'
E:\dev\c\Math\adb_addOperatorResponse.c:372: warning: unused variable 'qname_prefix'
E:\dev\c\Math\adb_addOperatorResponse.c:371: warning: unused variable 'qname_uri'
E:\dev\c\Math\adb_addOperatorResponse.c:367: warning: unused variable 'tag_closed'
E:\dev\c\Math\adb_addOperatorResponse.c: In function 'adb_addOperatorResponse_reset_addOperatorReturn':
E:\dev\c\Math\adb_addOperatorResponse.c:568: warning: unused variable 'element'
E:\dev\c\Math\adb_addOperatorResponse.c:567: warning: unused variable 'count'
E:\dev\c\Math\adb_addOperatorResponse.c:566: warning: unused variable 'i'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_extension_mapper.c -o obj\Debug\axis2_extension_mapper.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\axis2_extension_mapper.h:14,
                 from E:\dev\c\Math\axis2_extension_mapper.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\axis2_extension_mapper.c: In function 'axis2_extension_mapper_type_from_node':
E:\dev\c\Math\axis2_extension_mapper.c:31: warning: unused variable 'element_qname'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_stub_MathService.c -o obj\Debug\axis2_stub_MathService.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from C:\Tools\axis2c\include/neethi_includes.h:22,
                 from C:\Tools\axis2c\include/neethi_operator.h:29,
                 from C:\Tools\axis2c\include/neethi_policy.h:29,
                 from C:\Tools\axis2c\include/axis2_svc_client.h:56,
                 from C:\Tools\axis2c\include/axis2_stub.h:35,
                 from C:\Tools\axis2c\include/axis2_client.h:31,
                 from E:\dev\c\Math\axis2_stub_MathService.h:14,
                 from E:\dev\c\Math\axis2_stub_MathService.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\axis2_stub_MathService.c: In function 'axis2_stub_populate_services_for_MathService':
E:\dev\c\Math\axis2_stub_MathService.c:72: warning: unused variable 'status'
E:\dev\c\Math\axis2_stub_MathService.c:71: warning: unused variable 'neethi_policy'
E:\dev\c\Math\axis2_stub_MathService.c:70: warning: unused variable 'policy_root_ele'
E:\dev\c\Math\axis2_stub_MathService.c:69: warning: unused variable 'policy_node'
E:\dev\c\Math\axis2_stub_MathService.c:68: warning: unused variable 'desc'
E:\dev\c\Math\axis2_stub_MathService.c:66: warning: unused variable 'policy_include'
E:\dev\c\Math\axis2_stub_MathService.c: In function 'axis2_stub_on_complete_MathService_addOperator':
E:\dev\c\Math\axis2_stub_MathService.c:277: warning: unused variable 'soap_fault'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\main.c -o obj\Debug\main.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from C:\Tools\axis2c\include/neethi_includes.h:22,
                 from C:\Tools\axis2c\include/neethi_operator.h:29,
                 from C:\Tools\axis2c\include/neethi_policy.h:29,
                 from C:\Tools\axis2c\include/axis2_svc_client.h:56,
                 from C:\Tools\axis2c\include/axis2_stub.h:35,
                 from C:\Tools\axis2c\include/axis2_client.h:31,
                 from E:\dev\c\Math\axis2_stub_MathService.h:14,
                 from E:\dev\c\Math\main.c:1:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\main.c:3: warning: second argument of 'main' should be 'char **'
E:\dev\c\Math\main.c: In function 'main':
E:\dev\c\Math\main.c:8: warning: unused variable 'operation'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperator.c -o obj\Debug\adb_addOperator.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\adb_addOperator.h:21,
                 from E:\dev\c\Math\adb_addOperator.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\adb_addOperator.c: In function 'adb_addOperator_serialize_obj':
E:\dev\c\Math\adb_addOperator.c:574: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
E:\dev\c\Math\adb_addOperator.c:640: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
E:\dev\c\Math\adb_addOperator.c:480: warning: unused variable 'ns_already_defined'
E:\dev\c\Math\adb_addOperator.c:478: warning: unused variable 'qname_prefix'
E:\dev\c\Math\adb_addOperator.c:477: warning: unused variable 'qname_uri'
E:\dev\c\Math\adb_addOperator.c:473: warning: unused variable 'tag_closed'
E:\dev\c\Math\adb_addOperator.c: In function 'adb_addOperator_reset_num1':
E:\dev\c\Math\adb_addOperator.c:742: warning: unused variable 'element'
E:\dev\c\Math\adb_addOperator.c:741: warning: unused variable 'count'
E:\dev\c\Math\adb_addOperator.c:740: warning: unused variable 'i'
E:\dev\c\Math\adb_addOperator.c: In function 'adb_addOperator_reset_num2':
E:\dev\c\Math\adb_addOperator.c:848: warning: unused variable 'element'
E:\dev\c\Math\adb_addOperator.c:847: warning: unused variable 'count'
E:\dev\c\Math\adb_addOperator.c:846: warning: unused variable 'i'
mingw32-g++.exe -LC:\Tools\axis2c\include -LE:\dev\CodeBlocks\MinGW\lib  -o bin\Debug\Math.exe obj\Debug\adb_addOperatorResponse.o obj\Debug\axis2_extension_mapper.o obj\Debug\axis2_stub_MathService.o obj\Debug\main.o obj\Debug\adb_addOperator.o   -laxiom -laxutil -laxis2_engine -laxis2_parser  
e:/dev/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -laxiom
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 6 seconds)
1 errors, 35 warnings

看来,我犯了一个错误把../include在搜索目录>链接我固定的错误。



我生成项目,然后我得到这样的:

I build the project then I get this :

-------------- Build: Debug in Math ---------------

mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperatorResponse.c -o obj\Debug\adb_addOperatorResponse.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\adb_addOperatorResponse.h:21,
                 from E:\dev\c\Math\adb_addOperatorResponse.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\adb_addOperatorResponse.c: In function 'adb_addOperatorResponse_serialize_obj':
E:\dev\c\Math\adb_addOperatorResponse.c:466: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_extension_mapper.c -o obj\Debug\axis2_extension_mapper.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\axis2_extension_mapper.h:14,
                 from E:\dev\c\Math\axis2_extension_mapper.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_stub_MathService.c -o obj\Debug\axis2_stub_MathService.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from C:\Tools\axis2c\include/neethi_includes.h:22,
                 from C:\Tools\axis2c\include/neethi_operator.h:29,
                 from C:\Tools\axis2c\include/neethi_policy.h:29,
                 from C:\Tools\axis2c\include/axis2_svc_client.h:56,
                 from C:\Tools\axis2c\include/axis2_stub.h:35,
                 from C:\Tools\axis2c\include/axis2_client.h:31,
                 from E:\dev\c\Math\axis2_stub_MathService.h:14,
                 from E:\dev\c\Math\axis2_stub_MathService.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\main.c -o obj\Debug\main.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from C:\Tools\axis2c\include/neethi_includes.h:22,
                 from C:\Tools\axis2c\include/neethi_operator.h:29,
                 from C:\Tools\axis2c\include/neethi_policy.h:29,
                 from C:\Tools\axis2c\include/axis2_svc_client.h:56,
                 from C:\Tools\axis2c\include/axis2_stub.h:35,
                 from C:\Tools\axis2c\include/axis2_client.h:31,
                 from E:\dev\c\Math\axis2_stub_MathService.h:14,
                 from E:\dev\c\Math\main.c:1:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\main.c:3: warning: second argument of 'main' should be 'char **'
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperator.c -o obj\Debug\adb_addOperator.o
In file included from C:\Tools\axis2c\include/platforms/axutil_platform_auto_sense.h:40,
                 from C:\Tools\axis2c\include/axutil_dll_desc.h:31,
                 from C:\Tools\axis2c\include/axutil_class_loader.h:31,
                 from C:\Tools\axis2c\include/axis2_util.h:24,
                 from E:\dev\c\Math\adb_addOperator.h:21,
                 from E:\dev\c\Math\adb_addOperator.c:10:
C:\Tools\axis2c\include/platforms/windows/axutil_windows.h:221:5: warning: "/*" within comment
E:\dev\c\Math\adb_addOperator.c: In function 'adb_addOperator_serialize_obj':
E:\dev\c\Math\adb_addOperator.c:574: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
E:\dev\c\Math\adb_addOperator.c:640: warning: format '%I32d' expects type 'long int', but argument 3 has type 'int'
mingw32-g++.exe -LC:\Tools\axis2c\lib -LE:\dev\CodeBlocks\MinGW\lib  -o bin\Debug\Math.exe obj\Debug\adb_addOperatorResponse.o obj\Debug\axis2_extension_mapper.o obj\Debug\axis2_stub_MathService.o obj\Debug\main.o obj\Debug\adb_addOperator.o   -laxiom -laxutil -laxis2_engine -laxis2_parser  
obj\Debug\adb_addOperatorResponse.o: In function `adb_addOperatorResponse_create':
E:/dev/c/Math/adb_addOperatorResponse.c:58: undefined reference to `_imp__axutil_error_set_error_number'
E:/dev/c/Math/adb_addOperatorResponse.c:58: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:64: undefined reference to `_imp__axutil_strdup'
E:/dev/c/Math/adb_addOperatorResponse.c:67: undefined reference to `_imp__axutil_qname_create'
obj\Debug\adb_addOperatorResponse.o: In function `adb_addOperatorResponse_free_obj':
E:/dev/c/Math/adb_addOperatorResponse.c:139: undefined reference to `_imp__axutil_error_set_error_number'
E:/dev/c/Math/adb_addOperatorResponse.c:139: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:139: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:150: undefined reference to `_imp__axutil_qname_free'
obj\Debug\adb_addOperatorResponse.o: In function `adb_addOperatorResponse_deserialize_obj':
E:/dev/c/Math/adb_addOperatorResponse.c:209: undefined reference to `_imp__axutil_error_set_error_number'
E:/dev/c/Math/adb_addOperatorResponse.c:209: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:209: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:215: undefined reference to `_imp__axiom_node_get_next_sibling'
E:/dev/c/Math/adb_addOperatorResponse.c:213: undefined reference to `_imp__axiom_node_get_node_type'
E:/dev/c/Math/adb_addOperatorResponse.c:227: undefined reference to `_imp__axiom_node_get_data_element'
E:/dev/c/Math/adb_addOperatorResponse.c:228: undefined reference to `_imp__axiom_element_get_qname'
E:/dev/c/Math/adb_addOperatorResponse.c:229: undefined reference to `_imp__axutil_qname_equals'
E:/dev/c/Math/adb_addOperatorResponse.c:232: undefined reference to `_imp__axiom_node_get_first_child'
E:/dev/c/Math/adb_addOperatorResponse.c:237: undefined reference to `_imp__axutil_qname_to_string'
E:/dev/c/Math/adb_addOperatorResponse.c:237: undefined reference to `_imp__axutil_qname_to_string'
E:/dev/c/Math/adb_addOperatorResponse.c:260: undefined reference to `_imp__axiom_node_get_next_sibling'
E:/dev/c/Math/adb_addOperatorResponse.c:258: undefined reference to `_imp__axiom_node_get_node_type'
E:/dev/c/Math/adb_addOperatorResponse.c:264: undefined reference to `_imp__axiom_node_get_data_element'
E:/dev/c/Math/adb_addOperatorResponse.c:265: undefined reference to `_imp__axiom_element_get_qname'
E:/dev/c/Math/adb_addOperatorResponse.c:268: undefined reference to `_imp__axutil_qname_create'
E:/dev/c/Math/adb_addOperatorResponse.c:272: undefined reference to `_imp__axutil_qname_equals'
E:/dev/c/Math/adb_addOperatorResponse.c:274: undefined reference to `_imp__axutil_qname_equals'
E:/dev/c/Math/adb_addOperatorResponse.c:280: undefined reference to `_imp__axiom_element_get_text'
E:/dev/c/Math/adb_addOperatorResponse.c:298: undefined reference to `_imp__axutil_qname_free'
E:/dev/c/Math/adb_addOperatorResponse.c:308: undefined reference to `_imp__axutil_qname_free'
E:/dev/c/Math/adb_addOperatorResponse.c:317: undefined reference to `_imp__axutil_qname_free'
obj\Debug\adb_addOperatorResponse.o: In function `adb_addOperatorResponse_serialize_obj':
E:/dev/c/Math/adb_addOperatorResponse.c:392: undefined reference to `_imp__axutil_error_set_error_number'
E:/dev/c/Math/adb_addOperatorResponse.c:392: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:392: undefined reference to `_imp__axutil_error_set_status_code'
E:/dev/c/Math/adb_addOperatorResponse.c:395: undefined reference to `_imp__axutil_hash_make'
E:/dev/c/Math/adb_addOperatorResponse.c:398: undefined reference to `_imp__axiom_namespace_create'
E:/dev/c/Math/adb_addOperatorResponse.c:401: undefined reference to `_imp__axutil_strdup'
E:/dev/c/Math/adb_addOperatorResponse.c:401: undefined reference to `_imp__axutil_hash_set'
E:/dev/c/Math/adb_addOperatorResponse.c:404: undefined reference to `_imp__axiom_element_create'
E:/dev/c/Math/adb_addOperatorResponse.c:407: undefined reference to `_imp__axiom_element_set_namespace'
E:/dev/c/Math/adb_addOperatorResponse.c:411: undefined reference to `_imp__axiom_data_source_create'
E:/dev/c/Math/adb_addOperatorResponse.c:412: undefined reference to `_imp__axiom_data_source_get_stream'
E:/dev/c/Math/adb_addOperatorResponse.c:414: undefined reference to `_imp__axutil_hash_get'
E:/dev/c/Math/adb_addOperatorResponse.c:418: undefined reference to `_imp__axutil_hash_set'
E:/dev/c/Math/adb_addOperatorResponse.c:420: undefined reference to `_imp__axiom_namespace_create'
E:/dev/c/Math/adb_addOperatorResponse.c:420: undefined reference to `_imp__axiom_element_declare_namespace_assume_param_ownership'
E:/dev/c/Math/adb_addOperatorResponse.c:436: undefined reference to `_imp__axutil_strlen'
E:/dev/c/Math/adb_addOperatorResponse.c:436: undefined reference to `_imp__axutil_strlen'
E:/dev/c/Math/adb_addOperatorResponse.c:441: undefined reference to `_imp__axutil_strlen'
E:/dev/c/Math/adb_addOperatorResponse.c:441: undefined reference to `_imp__axutil_strlen'
E:/dev/c/Math/adb_addOperatorResponse.c:458: undefined reference to `_imp__axutil_strcmp'
Process terminated with status 1 (0 minutes, 9 seconds)
50 errors, 9 warnings

表格什么@MikeKinghan试图教我,我明白现在连接器的含义命令,我看到链接器设置正确这段时间。但为什么不能正确编译?

Form what @MikeKinghan tried to teach me, I understand the meaning of Linker commands now, and I see that the Linker is set correctly this time. but why can't it compile properly?

推荐答案

您的项目包含5个源文件,其中每个已被成功编译,然后将所有
需要连在一起,有些 AXIS2C 的DLL一起,打造你的程序。

Your project contains 5 source files, which each has to be successfully compiled, and then all need linked together, along with some axis2c DLLs, to build your program.

让我们看看你的build日志。

Let's look at your build log.

有对每个5个源文件的编译命令:

There is a compile command for each of the 5 source files:

mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperatorResponse.c -o obj\Debug\adb_addOperatorResponse.o
...
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_extension_mapper.c -o obj\Debug\axis2_extension_mapper.o
...
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\axis2_stub_MathService.c -o obj\Debug\axis2_stub_MathService.o
...
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\main.c -o obj\Debug\main.o
...
mingw32-gcc.exe -Wall  -g    -IC:\Tools\axis2c\include -IE:\dev\CodeBlocks\MinGW  -c E:\dev\c\Math\adb_addOperator.c -o obj\Debug\adb_addOperator.o
...

再有一个链接命令:

and then there is a link command:

mingw32-g++.exe -LC:\Tools\axis2c\include -LE:\dev\CodeBlocks\MinGW\lib  -o bin\Debug\Math.exe obj\Debug\adb_addOperatorResponse.o obj\Debug\axis2_extension_mapper.o obj\Debug\axis2_stub_MathService.o obj\Debug\main.o obj\Debug\adb_addOperator.o   -laxiom -laxutil -laxis2_engine -laxis2_parser
...

复制/粘贴这些命令某处在那里你可以从端到端看到他们。

Copy/paste these commands out somewhere where you can see them from end to end.

在所有的地方我已经把地方'...',编译或链接已发出有关程序的一些投诉。的

In all of the places where I have put '...', the compiler or linker has emitted some complaint about your program.

所有的5编译命令发出的诊断是的警告的。无论是不正确的,实际上它并不从编译源文件停止编译
文件( .C )成目标文件(的.o )。如果出现了任何编译的错误的任何 .C 文件,那么编译器不会已经能够创建的.o 文件,
和构建会停止,而不试图节目链接,因为链接它,当一些对象文件丢失将是徒劳的。

All of the diagnostics emitted by the 5 compile commands are warnings. Whatever is not right, it doesn't actually stop the compiler from compiling the source file (.c) into an object file (.o). If there had been any compilation errors in any .c file, then the compiler would not have been able to create the .o file, and the build would have stopped without attempting to link the program, because linking it when some object files are missing would be futile.

这确实的的意思是,你不必理会编译器警告。他们可能是对可能的警告的漏洞的在你的程序中,,其中一些是的。
所以,你需要解决这些问题。

This does not mean you don't have to bother about the compiler warnings. They might be warnings about possible bugs in your program, and some of them are. So you'll need to fix them.

链接命令具有的失败的。你有没有计划,这是你的首要问题。

The link command has failed. You have no program, which is your top problem.

为了使编译器和链接诊断的意识,并能够自己解决这些问题,您需要了解编译器和链接命令的意思。

In order to make sense of compiler and linker diagnostics, and be able to fix them yourself, you need to understand what the compiler and linker commands mean.

我们可以看到,工具链code :: Blocks的推动,就会为您的 GCC(GNU编译器集合)
GCC是C / C ++编程工具链的爸爸:它支持所有的操作系​​统和处理器的每一个;它在每一个应用领域使用。
它是完全独立于任何众多的集成开发环境,你可以得到驾驶它,而所有这些的IDE(Eclipse中,code ::块,KDevelop的,codeLite,Anjuta的的,
DEV-C ++等)来给你带您了解编译和链接GCC隐含的假设。至少,他们没有可以的为您节省的不必
要了解编译和链接GCC

We can see that the toolchain Code::Blocks is driving for you is the MinGW project's 32-bit Windows port of GCC (The GNU Compiler Collection). GCC is the daddy of C/C++ programming toolchains: it's supported for every operating system and every processor; it's used in every application domain. It's completely independent of any of the numerous IDEs that you can get to drive it, and all of those IDEs (Eclipse, Code::Blocks, KDevelop, CodeLite, Anjuta, Dev-C++, etc.) come to you with the implicit assumption that you understand compiling and linking with GCC. At least, none of them can save you from having to understand compiling and linking with GCC.

在继续之前那么,这一切的生命的教训将是:踢了你的IDE一段时间。了解建设计划,GCC,本身。
然后,它会很明显如何与你的IDE做到这一点。

Before going any further then, the life-lesson of all this is going to be: Kick away your IDE for a while. Learn about building programs with GCC, itself. Then it will be obvious how to do it with your IDE.

你所有的编译命令是由的mingw32-gcc.exe 执行。这就是GCC工具的驱动程序,在其的 C编译器的姿态。如果你在它的安装目录看,
也许 C:\\ MinGW的\\ BIN ,你还会看到节目 gcc.exe 。g ++的exe文件,再加上那两个用preFIX 的mingw32 - 。所有这些程序
在海湾合作委员会工具驱动器,在不同的姿势适应不同的角色。

All of your compile commands are executed by mingw32-gcc.exe. That's the GCC tool-driver, in its C compiler "posture". If you look in the directory where it's installed, maybe C:\MinGW\bin, you'll see also programs gcc.exe, g++.exe, plus those two with the prefix mingw32-. All of these programs are the GCC tool driver, in different "postures" adapted to different roles.

您链接命令是由的mingw32-g ++的执行。exe文件。这就是GCC工具再次驱动,在其的 C ++链接器的姿态。这似乎令人费解的是code :: Blocks的
默认配置的 C ++ 的链接链接的 C 的节目。它确实是因为C ++联动工作,该都是C中,所有的C ++,或两者的混合物的方案。
不过,C链接不会为C ++程序的工作。

Your link command is executed by mingw32-g++.exe. That's the GCC tool-driver again, in its C++ linker "posture". It may seem puzzling that Code::Blocks by default configures the C++ linker to link C programs. It does that because C++ linkage works for programs that are all C, all C++, or a mixture of the two. But C linkage won't work for C++ programs.

无论姿势是由顾名思义,海合会工具驱动程序计算出需要通过检查其命令行和选项的文件扩展名做什么
中传递给它的文件。因此,它试图编译每个 .C 源文件为C的,因为的他们是 .C 文件。
如果他们的.cpp 文件,那么它会尝试把它们编译成C ++。一旦计算出它是什么做的,它代表的工作,以适当的专用工具 -
C编译器,C ++编译器,汇编器,连接器。

Whatever "posture" is suggested by the name, the GCC tool driver figures out what needs to be done by inspecting the options on its commandline and the file extensions of the files that are passed to it. So it tries to compile each of your .c source files as C because they are .c files. If they were .cpp files then it would try to compile them as C++. Once it figures out what it do, it delegates the work to an appropriate specialized tool - C compiler, C++ compiler, assembler, linker.

下面就是每个编译命令的方式:

Here's what each of your compile commands means:


  • -Wall =>启用所有警告

  • -g =>生成的目标文件中的调试信息。

  • -IC:\\工具\\ AXIS2C \\包含 =>在 C:\\工具\\ AXIS2C \\包含

  • - 即:\\ dev的\\ $ C $个cblocks \\的MinGW =>还搜索非标准的头文件 E:\\ dev的\\ $ C $个cblocks \\的MinGW

  • -c =>只是汇编;不要链接

  • E:\\ dev的\\ C \\数学\\ some_filename.c =>编译该文件

  • -o OBJ \\调试\\ some_filename.o =>输出对象文件 OBJ \\调试\\ some_filename.o

  • -Wall => Enable all warnings
  • -g => Generate debugging information in the object file.
  • -IC:\Tools\axis2c\include => Search for non-standard header files in C:\Tools\axis2c\include
  • -IE:\dev\CodeBlocks\MinGW => Also search for non-standard header files in E:\dev\CodeBlocks\MinGW
  • -c => Just compile; don't link
  • E:\dev\c\Math\some_filename.c => Compile this file.
  • -o obj\Debug\some_filename.o => Output the object file obj\Debug\some_filename.o

和这里是你的链接命令意味着什么:

And here's what your link command means:


  • -LC:\\工具\\ AXIS2C \\包含 =>搜索非标准库(的.lib .A 的.dll )的 C:\\工具\\ AXIS2C \\包含

  • -LE:\\ dev的\\ $ C $个cblocks \\ ​​MinGW的\\ lib中 =>还搜索非标准图书馆 E:\\ dev的\\ $ C $个cblocks \\ ​​MinGW的\\ lib中

  • -o斌\\调试\\ Math.exe =>输出可执行斌\\调试\\ Math.exe

  • OBJ \\调试\\ adb_addOperatorResponse.o =>链接这个目标文件

  • OBJ \\调试\\ axis2_extension_mapper.o =>也链接这个目标文件

  • OBJ \\调试\\ axis2_stub_MathService.o =>也链接这个目标文件

  • OBJ \\调试\\ main.o中 =>也链接这个目标文件

  • OBJ \\调试\\ adb_addOperator.o =>也链接这个目标文件

  • -laxiom =>链接libary axiom.dll 或做不到这一点,公理的.lib libaxiom.a ,无论它是第一个在指定的链接发现
    搜索目录( -L ),或未能在链接器的标准目录。

  • -laxutil =>链接libary axutil.dll 或做不到这一点, axutil的.lib libaxutil.a ,等...

  • -laxis2_engine =>链接libary axis2_engine.dll 或做不到这一点, axis2_engine的.lib libaxis2_engine.a ,等...

  • -laxis2_parser =>链接libary axis2_parser.dll 或做不到这一点, axis2_parser的.lib libaaxis2_parser.a ,等...

  • -LC:\Tools\axis2c\include => Search for non-standard libraries (.lib, .a, .dll) in C:\Tools\axis2c\include
  • -LE:\dev\CodeBlocks\MinGW\lib => Also search for non-standard libraries in E:\dev\CodeBlocks\MinGW\lib
  • -o bin\Debug\Math.exe => Output the executable bin\Debug\Math.exe
  • obj\Debug\adb_addOperatorResponse.o => Link this object file
  • obj\Debug\axis2_extension_mapper.o => Also link this object file
  • obj\Debug\axis2_stub_MathService.o => Also link this object file
  • obj\Debug\main.o => Also link this object file
  • obj\Debug\adb_addOperator.o => Also link this object file
  • -laxiom => Link the libary axiom.dll or failing that, axiom.lib or libaxiom.a, wherever it is first found in the specified linker search directories (-L), or failing that in the linker's standard directories.
  • -laxutil => Link the libary axutil.dll or failing that, axutil.lib or libaxutil.a, etc...
  • -laxis2_engine => Link the libary axis2_engine.dll or failing that, axis2_engine.lib or libaxis2_engine.a, etc...
  • -laxis2_parser => Link the libary axis2_parser.dll or failing that, axis2_parser.lib or libaaxis2_parser.a, etc...

您可能不知道的工具司机是怎么知道该链接命令的的链接命令,也许没有一个C ++编译命令?
它知道有没有编译做,因为没有输入文件的可以编译的。他们是所有目标文件(的.o )。
而且它知道它是应该的链接,因为它并没有被告知的他们的的链接他们: -c 选项是不存在的。

You might wonder how the tool-driver knows that the link command is a link command, and not perhaps a C++ compile command? It knows there is no compiling to do because none of the input files can be compiled. They are all object files (.o). And it knows it is supposed to link them because it hasn't been told not to link them: the -c option is absent.

您链接失败原因:

e:/dev/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -laxiom

ld.exe 是链接本身:专业的工具,海湾合作委员会工具驱动程序时有链接到完成调用。
它无法找到公理库中的任何您指定的链接搜索目录( -L ),也不是,当然,在
任何标准的搜索目录。

ld.exe is the linker itself: the specialized tool that the GCC tool driver invokes when there is linking to be done. It can't find your axiom library in any of the linker search directories you specified (-L), nor, of course, in any of the standard search directories.

现在您了解您的链接命令的含义,它会很容易让你看到什么是错的。链接器
您指定的搜索目录是:

Now that you understand the meaning of your link command, it will be easy for you to see what's wrong. The linker search directories that you specified are:

C:\Tools\axis2c\include
E:\dev\CodeBlocks\MinGW\lib

和您的 AXIS2C 库( axiom.dll 等)都没有在任何这些地方。 C:\\工具\\ AXIS2C \\包含
是你告诉了同一个地方的编译的来搜索 AXIS2C 头文件的:你有:

and your axis2c libraries (axiom.dll etc) aren't in either of those places. C:\Tools\axis2c\include is the same place where you told the compiler to search for the axis2c header files: you have:

-IC:\Tools\axis2c\include

所以,如果这也正是 AXIS2C 头文件,那么库,我想,在 C:\\工具\\ AXIS2C \\ lib中。看一看。
假设是正确的,那么你需要删除错误 C时Ç::乙IDE:\\工具\\ AXIS2C \\包含搜索目录 - > 链接
为您的项目,并用正确的 c更换它:\\工具\\ AXIS2C \\ lib中离开 C:\\工具\\ AXIS2C \\包含搜索目录 - > 编译
因为这是正确的。

So if that's where the axis2c header files are, then the libraries, I guess, are in C:\Tools\axis2c\lib. Have a look. Assuming that's right, then in the C::B IDE you need to delete the wrong C:\Tools\axis2c\include from Search directories -> Linker for your project and replace it with the correct C:\Tools\axis2c\lib Leave C:\Tools\axis2c\include in Search directories -> Compiler, because that is correct.

持续了OP的进一步的问题

我相信你的 AXIS2C 库和头文件源自的 Apache的Axis2中/ C下载页面
从存档 axis2c-bin-1.6.0-win32.zip

I believe that your axis2c libraries and header files originated from Apache's Axis2/C download page from the archive axis2c-bin-1.6.0-win32.zip.

该版本在其头文件一个错误会导致连杆遭受错误
您所看到的MINGW32工具链。

This release suffers from a bug in its header files that causes the linkage errors you are seeing with the MinGW32 toolchain.

这个错误并不影响谷歌的的Axis2 / C 的发行版我提到你
在我第一次回答这个问题。当时你说你用64位MinGW的建设,但它有自
很清楚,您正在使用32位MinGW的建设。在这种情况下,你应该下载<一个href=\"https://$c$c.google.com/p/axis2c-unofficial/downloads/detail?name=axis2c-unofficial-mingw-7acae470da50.7z\"相对=nofollow>谷歌的32位建立的Axis2 / C

This bug does not affect Google's release of Axis2/C that I referred you to in my first answer to this question. At that time you said that you were building with 64-bit MinGW, but it has since become clear that you are building with 32-bit MinGW. In that case, you should download Google's 32-bit build Axis2/C

解压缩7-Zip的档案,并从 AXIS2C 重命名解压后的文件夹 AXIS2C 86谷歌,使它很清楚是什么,然后复制它方便的地方
为您的发展。比方说,你把它放在 C:\\工具\\ AXIS2C 86谷歌

Unzip the archive with 7-Zip and rename the unzipped folder from axis2c to axis2c-x86-google, to make clear what it is, then copy it somewhere convenient for your development. Let's say you put it at C:\Tools\axis2c-x86-google.

然后在C ::乙IDE,在搜索目录 - > 编译,更改:

Then in the C::B IDE, in Search directories -> Compiler, change:

C:\Tools\axis2c\include

C:\Tools\axis2c-x86-google\include\axis2-1.6.0

搜索目录 - > 链接,更改:

C:\Tools\axis2c\lib

C:\Tools\axis2c-x86-google\lib

这就是所谓 axiom.dll 在Apache版本图书馆是在谷歌的发布名为 axis2_axiom.dll 。因此
链接器设置 - > 其他连接器选项,更改:

The library that is called axiom.dll in the Apache release is called axis2_axiom.dll in Google's release. Therefore in your Linker settings -> Other linker options, change:

-laxiom

-laxis2_axiom

您的程序,然后成功地链接(对我来说)。

Your program then links successfully (for me).

续再次

根据您的意见,该方案目前无法在运行时,出现错误加载:

Per your comments, the program now fails to load at runtime with the error:

The procedure entry point axis2_callback_create could not be located in the dynamic link library

这意味着正确的DLL提供 axis2_callback_create 在运行时不会找到。

This means the correct DLL providing axis2_callback_create is not found at runtime.

您说的:

我还添加了LIB到路径环境。并且还增加了LIB dll文件到C:\\ WINDOWS \\ Syswow64资料

I also added the "lib" to path environment. and also added the lib dll files to "C:\Windows\SysWOW64"


  • 请一个或另一个,而不是两个。

  • 根据你对Axis2的/ C库目录添加到 PATH什么,它可能没有效果。

    • If you did this in a shell (command prompt) window that was not the very same one in which your tried to run your
      program, then it will have had no effect, since environment settings that you make in a shell apply only to
      processes launched in the same shell.

    • If you did this by modifying the <$c$c>PATH environment variable in Advanced System Settings then that will have
      no effect on a shell already open in which you tried to run your program. You would need save the Advanced System Settings
      and then try again to run your program in a new shell.

    • Do one or the other, not both.
    • Depending on what you did to add the Axis2/C library directory to the PATH, it may have had no effect.
      • If you did this in a shell (command prompt) window that was not the very same one in which your tried to run your program, then it will have had no effect, since environment settings that you make in a shell apply only to processes launched in the same shell.
      • If you did this by modifying the PATH environment variable in Advanced System Settings then that will have no effect on a shell already open in which you tried to run your program. You would need save the Advanced System Settings and then try again to run your program in a new shell.
      • I am able to start your program without DLL errors in all of the following ways:

        I am able to start your program without DLL errors in all of the following ways:


        • With all of the files <$c$c>C:\\Tools\\axis2c-x86-google\\lib\\*.dll located in the same directory with <$c$c>Math.exe

        • With all of the files <$c$c>C:\\Tools\\axis2c-x86-google\\lib\\*.dll located instead in <$c$c>C:Windows\\SysWOW64

        • In a shell window in which I have $p$pviously run: <$c$c>set PATH=%PATH%;C:\\path\\to\\my\\axis2c-x86-google\\lib

        • In a new shell after I have added <$c$c>C:\\path\\to\\my\\axis2c-x86-google\\lib to the <$c$c>PATH environment
          variable in Advanced System Settings.

        • With all of the files C:\Tools\axis2c-x86-google\lib\*.dll located in the same directory with Math.exe
        • With all of the files C:\Tools\axis2c-x86-google\lib\*.dll located instead in C:Windows\SysWOW64
        • In a shell window in which I have previously run: set PATH=%PATH%;C:\path\to\my\axis2c-x86-google\lib
        • In a new shell after I have added C:\path\to\my\axis2c-x86-google\lib to the PATH environment variable in Advanced System Settings.

        If none of them works for you then I'm afraid the problem is beyond me :(

        If none of them works for you then I'm afraid the problem is beyond me :(

        这篇关于程序输入点axiom_attribute_create不能设在动态链接库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆