About creating Smart Device DLL using Libxml2
-
Hello all, I am currently doing my FYP. I download a set of header files of libxml2 with .h files and .lib files. I first try to create a windows 32 application console application and it works fine (to ensure i link it properly) I then head off and try to create a DLLs for the smart device, however, i return with the following errors: Linking... 1> Creating library Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.lib and object Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.exp 1>TESTTESTTEST.obj : error LNK2019: unresolved external symbol xmlParseFile referenced in function ExportedFunction 1>Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.dll : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\wu\My Documents\Visual Studio 2005\Projects\TESTTESTTEST\TESTTESTTEST\Windows Mobile 6 Professional SDK (ARMV4I)\Debug\BuildLog.htm" 1>TESTTESTTEST - 2 error(s), 1 warning(s) I created my DLL like this: #include "resourceppc.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include "xmlmemory.h" #include "parser.h" extern "C" void EXPORT ExportedFunction(){ char * docname = "abc"; xmlDocPtr doc; xmlNodePtr cur; doc = xmlParseFile(docname); } Being noob, i just want to know: 1. It is possible to create a DLL using .lib files ? 2. Is my linking wrong ? Any help of somekind will be greatly appreciated ! Thanks, Leslie
-
Hello all, I am currently doing my FYP. I download a set of header files of libxml2 with .h files and .lib files. I first try to create a windows 32 application console application and it works fine (to ensure i link it properly) I then head off and try to create a DLLs for the smart device, however, i return with the following errors: Linking... 1> Creating library Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.lib and object Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.exp 1>TESTTESTTEST.obj : error LNK2019: unresolved external symbol xmlParseFile referenced in function ExportedFunction 1>Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.dll : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\wu\My Documents\Visual Studio 2005\Projects\TESTTESTTEST\TESTTESTTEST\Windows Mobile 6 Professional SDK (ARMV4I)\Debug\BuildLog.htm" 1>TESTTESTTEST - 2 error(s), 1 warning(s) I created my DLL like this: #include "resourceppc.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include "xmlmemory.h" #include "parser.h" extern "C" void EXPORT ExportedFunction(){ char * docname = "abc"; xmlDocPtr doc; xmlNodePtr cur; doc = xmlParseFile(docname); } Being noob, i just want to know: 1. It is possible to create a DLL using .lib files ? 2. Is my linking wrong ? Any help of somekind will be greatly appreciated ! Thanks, Leslie
I think the issue is that you've downloaded an x86 Win32 implementation of libxml2. You're then trying to link that into a Windows Mobile DLL that's targetting an ARM processor. Now, ARM != x86, so you're going to have to find some ARM Win32 binaries from somewhere - that probably means building it from source yourself... What;s wrong with using Microsoft's XML libraries? Aren't they bundled with Windows Mobile? If so, that'd be simpler than trying to install libxml2...
-
Hello all, I am currently doing my FYP. I download a set of header files of libxml2 with .h files and .lib files. I first try to create a windows 32 application console application and it works fine (to ensure i link it properly) I then head off and try to create a DLLs for the smart device, however, i return with the following errors: Linking... 1> Creating library Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.lib and object Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.exp 1>TESTTESTTEST.obj : error LNK2019: unresolved external symbol xmlParseFile referenced in function ExportedFunction 1>Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.dll : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\wu\My Documents\Visual Studio 2005\Projects\TESTTESTTEST\TESTTESTTEST\Windows Mobile 6 Professional SDK (ARMV4I)\Debug\BuildLog.htm" 1>TESTTESTTEST - 2 error(s), 1 warning(s) I created my DLL like this: #include "resourceppc.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include "xmlmemory.h" #include "parser.h" extern "C" void EXPORT ExportedFunction(){ char * docname = "abc"; xmlDocPtr doc; xmlNodePtr cur; doc = xmlParseFile(docname); } Being noob, i just want to know: 1. It is possible to create a DLL using .lib files ? 2. Is my linking wrong ? Any help of somekind will be greatly appreciated ! Thanks, Leslie
-
Hi Stuart, Thank you for your answer first. I know you must be wondering why we don't use the integrated XML, but it is my supervisor request (OMG ~). We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment. Do you have any idea if there is any avaliable library avaliable ? If so, very appreicated if you could just post the link ! Thanks, Leslie
-
Hi Stuart, Thank you for your answer first. I know you must be wondering why we don't use the integrated XML, but it is my supervisor request (OMG ~). We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment. Do you have any idea if there is any avaliable library avaliable ? If so, very appreicated if you could just post the link ! Thanks, Leslie
leslie wu wrote:
We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment
libxml would be the best choice in my opinion, it is widely used in non-Microsoft commercial products. You should compile the libxml library from source rather than using the pre-compiled libraries. Although commonly used... the designation 'Win32' is somewhat a misnomer by being an incomplete description. It would more accurate if defined as 'Win32-x86'. Best Wishes, -David Delaune
-
Hi Stuart, Thank you for your answer first. I know you must be wondering why we don't use the integrated XML, but it is my supervisor request (OMG ~). We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment. Do you have any idea if there is any avaliable library avaliable ? If so, very appreicated if you could just post the link ! Thanks, Leslie
-
Being a Noob, I just want to ask 2 more questions: 1.I have download all the header and the C files associated with the library. If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ? 2. When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ? Thanks, Leslie
-
Being a Noob, I just want to ask 2 more questions: 1.I have download all the header and the C files associated with the library. If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ? 2. When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ? Thanks, Leslie
leslie wu wrote:
If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ?
You need to have compiled the C files into a library - either a static library (a .lib file), or a dynamic library (a .dll file) with associated import library (also a .lib file). You can link against either .lib file, but if you link against the dynamic library version, you need to deploy the .dll file with your project.
leslie wu wrote:
When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ?
The processor is the same, but the operating system is (very) different - you cannot use iPhone binaries on the Windows Mobile platform, as it will expect to be able to call OS X.
-
Being a Noob, I just want to ask 2 more questions: 1.I have download all the header and the C files associated with the library. If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ? 2. When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ? Thanks, Leslie
Another XML library you might want to consider is Expat[^], if only because it has a Visual Studio 6 project file in the source distribution that you could use as a starting point for building it for the Windows Mobile target - you'd need to change the project's target from x86 Win32 to the correct one for your WIndows Mobile target, but that should be relatively trivial.