Hi
I'm building a webservice in axis2c and wanna test it with a client.
I build the skeleton code for the client using the wsdl2c tool in axis.
Now, when I build the solution in Dev-C++, I get a lot of linker errors like the one mentioned in the title:

In function main:
[Linker error] undefined reference to '_imp__axutil_env_create_all'
In function axis2_stub_create_SearchDocs:
[Linker error] undefined reference to '_imp__axutil_error_set_error_number'
[Linker error] undefined reference to '_imp__axutil_error_set_status_code'
etc......

I've been doing a lot of googling and it seems I need some libraries, but can't figure out which ones.
In Dev-C++ I have added all the .lib files from axis2c->lib.
And I have included all the files from the axis2c->include library to the project.
Any help would be appreciated.

Did you tell the linker
- where to find the axutil library
- to actually use the axutil library.

The #include in your source code just tells the compiler that something exists (like say cout). But you also need a library for the actual implementation, and that's where the linker comes in.

Standard things like the library containing cout are automatically linked for you, so you don't tend to notice what is going on.

Did you tell the linker
- where to find the axutil library
- to actually use the axutil library.

I've told the linker to use axutil.lib in the axis2c\lib together with all the other libs in that directory.

Are these libraries built for dev-c++ (or MinGW).

You can't take take libraries originally aimed at say Visual Studio and use them "as is" with your compiler.
Options
- there is a library conversion tool somewhere to alter the format of libraries
- ask whoever gave you the libraries to sent MinGW/Dev-C++ compatible ones
- get the axutil source code and build the libraries yourself.


Can you post the complete compile and link log as well.

I've attached the complete logfile here.
I've tried to build in Visual Studio also, but that also gives linker errors.

Attachments
Compiler: Default compiler
Building Makefile: "H:\profile\Dokumenter\C++ Projects\SearchDocsClientTest\Makefile.win"
Executing  make clean
rm -f SearchDocs.o adb_getContextFromFilename.o adb_getContextFromFilenameResponse.o adb_getContextFromSigID.o adb_getContextFromSigIDResponse.o adb_getDocument.o adb_getDocumentReadingDifficulty.o adb_getDocumentReadingDifficultyResponse.o adb_getDocumentResponse.o adb_getDocuments.o adb_getDocumentsResponse.o adb_getNodeIDs.o adb_getNodeIDsResponse.o adb_getSigIDs.o adb_getSigIDsResponse.o adb_getWordCharPositions.o adb_getWordCharPositionsResponse.o adb_getWordCountedPositions.o adb_getWordCountedPositionsResponse.o axis2_stub_SearchDocs.o  SearchDocsClient.exe

gcc.exe -D__DEBUG__ -c SearchDocs.c -o SearchDocs.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getContextFromFilename.c -o adb_getContextFromFilename.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getContextFromFilenameResponse.c -o adb_getContextFromFilenameResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getContextFromSigID.c -o adb_getContextFromSigID.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getContextFromSigIDResponse.c -o adb_getContextFromSigIDResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocument.c -o adb_getDocument.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocumentReadingDifficulty.c -o adb_getDocumentReadingDifficulty.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocumentReadingDifficultyResponse.c -o adb_getDocumentReadingDifficultyResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocumentResponse.c -o adb_getDocumentResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocuments.c -o adb_getDocuments.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getDocumentsResponse.c -o adb_getDocumentsResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getNodeIDs.c -o adb_getNodeIDs.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getNodeIDsResponse.c -o adb_getNodeIDsResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getSigIDs.c -o adb_getSigIDs.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getSigIDsResponse.c -o adb_getSigIDsResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getWordCharPositions.c -o adb_getWordCharPositions.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getWordCharPositionsResponse.c -o adb_getWordCharPositionsResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getWordCountedPositions.c -o adb_getWordCountedPositions.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c adb_getWordCountedPositionsResponse.c -o adb_getWordCountedPositionsResponse.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ -c axis2_stub_SearchDocs.c -o axis2_stub_SearchDocs.o -I"include"  -I"C:/axis2c-bin-1.6.0-win32/include"    -g3

gcc.exe -D__DEBUG__ SearchDocs.o adb_getContextFromFilename.o adb_getContextFromFilenameResponse.o adb_getContextFromSigID.o adb_getContextFromSigIDResponse.o adb_getDocument.o adb_getDocumentReadingDifficulty.o adb_getDocumentReadingDifficultyResponse.o adb_getDocumentResponse.o adb_getDocuments.o adb_getDocumentsResponse.o adb_getNodeIDs.o adb_getNodeIDsResponse.o adb_getSigIDs.o adb_getSigIDsResponse.o adb_getWordCharPositions.o adb_getWordCharPositionsResponse.o adb_getWordCountedPositions.o adb_getWordCountedPositionsResponse.o axis2_stub_SearchDocs.o  -o "SearchDocsClient.exe" -L"lib" -L"C:/axis2c-bin-1.6.0-win32/lib" C:/axis2c-bin-1.6.0-win32/lib/axiom.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_engine.lib C:/axis2c-bin-1.6.0-win32/lib/axutil.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_http_receiver.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_http_sender.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_parser.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_tcp_receiver.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_tcp_sender.lib C:/axis2c-bin-1.6.0-win32/lib/axis2_xpath.lib -axutil -axiom -axis2_engine -axis2_parser -axis2_http_sender -axis2_http_receiver -axis2_tcp_receiver -axis2_tcp_sender -axis2_xpath  -g3 

SearchDocs.o(.text+0x64): In function `main':
H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/SearchDocs.c:19: undefined reference to `_imp__axutil_env_create_all'
SearchDocs.o(.text+0x94):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/SearchDocs.c:24: undefined reference to `_imp__axutil_strcmp'
SearchDocs.o(.text+0x149):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/SearchDocs.c:40: undefined reference to `_imp__axutil_error_get_message'
SearchDocs.o(.text+0x21e):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/SearchDocs.c:54: undefined reference to `_imp__axis2_stub_free'
SearchDocs.o(.text+0x231):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/SearchDocs.c:59: undefined reference to `_imp__axutil_env_free'
adb_getContextFromFilename.o(.text+0x48): In function `adb_getContextFromFilename_create':
H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:82: undefined reference to `_imp__axutil_error_set_error_number'
adb_getContextFromFilename.o(.text+0x60):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:82: undefined reference to `_imp__axutil_error_set_status_code'
adb_getContextFromFilename.o(.text+0xe8):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:95: undefined reference to `_imp__axutil_qname_create'
adb_getContextFromFilename.o(.text+0x279): In function `adb_getContextFromFilename_free':
H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:184: undefined reference to `_imp__axutil_error_set_error_number'
adb_getContextFromFilename.o(.text+0x291):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:184: undefined reference to `_imp__axutil_error_set_status_code'
adb_getContextFromFilename.o(.text+0x2b5):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:184: undefined reference to `_imp__axutil_error_set_status_code'
adb_getContextFromFilename.o(.text+0x31b):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:193: undefined reference to `_imp__axutil_qname_free'
adb_getContextFromFilename.o(.text+0x3bb): In function `adb_getContextFromFilename_deserialize':
H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:232: undefined reference to `_imp__axutil_error_set_error_number'
adb_getContextFromFilename.o(.text+0x3d3):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:232: undefined reference to `_imp__axutil_error_set_status_code'
adb_getContextFromFilename.o(.text+0x3f7):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:232: undefined reference to `_imp__axutil_error_set_status_code'
adb_getContextFromFilename.o(.text+0x411):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:236: undefined reference to `_imp__axiom_node_get_node_type'
adb_getContextFromFilename.o(.text+0x42a):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:238: undefined reference to `_imp__axiom_node_get_next_sibling'
adb_getContextFromFilename.o(.text+0x47d):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:250: undefined reference to `_imp__axiom_node_get_data_element'
adb_getContextFromFilename.o(.text+0x49b):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:251: undefined reference to `_imp__axiom_element_get_qname'
adb_getContextFromFilename.o(.text+0x4bb):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:252: undefined reference to `_imp__axutil_qname_equals'
adb_getContextFromFilename.o(.text+0x4d3):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:255: undefined reference to `_imp__axiom_node_get_first_child'
adb_getContextFromFilename.o(.text+0x4ec):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:260: undefined reference to `_imp__axutil_qname_to_string'
adb_getContextFromFilename.o(.text+0x504):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:260: undefined reference to `_imp__axutil_qname_to_string'
adb_getContextFromFilename.o(.text+0x567):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:281: undefined reference to `_imp__axiom_node_get_node_type'
adb_getContextFromFilename.o(.text+0x580):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:283: undefined reference to `_imp__axiom_node_get_next_sibling'
adb_getContextFromFilename.o(.text+0x59f):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:287: undefined reference to `_imp__axiom_node_get_data_element'
adb_getContextFromFilename.o(.text+0x5bd):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:288: undefined reference to `_imp__axiom_element_get_qname'
adb_getContextFromFilename.o(.text+0x5e5):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:291: undefined reference to `_imp__axutil_qname_create'
adb_getContextFromFilename.o(.text+0x617):H:/profile/Dokumenter/C++ Projects/SearchDocsClientTest/adb_getContextFromFilename.c:294: undefined reference to `_imp__axutil_qname_equals'
adb_getContextFromFilename.o(.text+0x646):H:

Well this lot just seems wrong to me

C:/axis2c-bin-1.6.0-win32/lib/axiom.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_engine.lib 
C:/axis2c-bin-1.6.0-win32/lib/axutil.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_http_receiver.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_http_sender.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_parser.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_tcp_receiver.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_tcp_sender.lib 
C:/axis2c-bin-1.6.0-win32/lib/axis2_xpath.lib 
-axutil 
-axiom 
-axis2_engine 
-axis2_parser 
-axis2_http_sender 
-axis2_http_receiver 
-axis2_tcp_receiver 
-axis2_tcp_sender 
-axis2_xpath

All the green options would appear to be linking the entire library, whether you need it or not.

The usual syntax (on a Linux/Unix machine at least) would be to say something like -laxutil But for this, perhaps you should state -laxiom.lib That's a lower-case 'L' at the start BTW.
You've already set the path with a -L option, so there is no need to state the full path to each library again.

For sure, the red options are just plain wrong. The linker isn't going to do anything with them.

Hi

Problem solved.
As stated in an earlier reply from Salem, the libraries used were VC++ compiled and therefor could not be used with MinGW/Dev-C++.
I solved the problem by using a tool to create definition files from the existing dll's.
I then edited the stdcall functions in the definition files. All the stdcall functions in the file were in the form "_name@ordinal". I simply changed it to be just "name".
This would have worked also:
name = _name@ordinal
I then used dlltool to create .a files from the dll's and the definition files, .def.
After this, the linking went OK.

Comments
Nice job, and thanks for the summary :)
This question has already been answered. Start a new discussion instead.