Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. About creating Smart Device DLL using Libxml2

About creating Smart Device DLL using Libxml2

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpvisual-studiodebuggingquestion
9 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leslie wu
    wrote on last edited by
    #1

    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

    S 2 Replies Last reply
    0
    • L leslie wu

      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

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      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...

      1 Reply Last reply
      0
      • L leslie wu

        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

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        One other XML alternative (from this very site!) - PugXML[^] - it's lightweight and simple to build!!!

        L 1 Reply Last reply
        0
        • S Stuart Dootson

          One other XML alternative (from this very site!) - PugXML[^] - it's lightweight and simple to build!!!

          L Offline
          L Offline
          leslie wu
          wrote on last edited by
          #4

          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

          L S 2 Replies Last reply
          0
          • L leslie wu

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • L leslie wu

              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

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              As Randor says - libxml, and it looks like you're building it from sources...see this page[^] for download links! Good luck!

              L 1 Reply Last reply
              0
              • S Stuart Dootson

                As Randor says - libxml, and it looks like you're building it from sources...see this page[^] for download links! Good luck!

                L Offline
                L Offline
                leslie wu
                wrote on last edited by
                #7

                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

                S 2 Replies Last reply
                0
                • L leslie wu

                  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

                  S Offline
                  S Offline
                  Stuart Dootson
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • L leslie wu

                    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

                    S Offline
                    S Offline
                    Stuart Dootson
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups