Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. libxml2 in qt with wingw32 library adding problem
Qt 6.11 is out! See what's new in the release blog

libxml2 in qt with wingw32 library adding problem

Scheduled Pinned Locked Moved General and Desktop
libxml2windowswinwg32
8 Posts 2 Posters 5.4k Views 2 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.
  • I Offline
    I Offline
    IboniuS
    wrote on last edited by IboniuS
    #1

    Hello,

    I'm trying to develop some program that needs to read xml files. I want to develop it using libxm because I need to cross-compile it in a Embedded Linux system latter.

    I use this precompiled library: ftp://ftp.zlatkovic.com/libxml/

    I want to execute this io example: http://www.xmlsoft.org/examples/io1.c

    I want to execute it, but It doesn't work properly and I have this return:

    Starting C:\workspace\build\build-libxml_helloWorld-Desktop_Qt_5_3_MinGW_32bit-Release\release\libxml_helloWorld.exe... C:\workspace\build\build-libxml_helloWorld-Desktop_Qt_5_3_MinGW_32bit-Release\release\libxml_helloWorld.exe exited with code -1073741515

    I have .pro file like this:

    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt
    
    SOURCES += main.cpp
    
    include(deployment.pri)
    qtcAddDeployment()
    
    
    win32: LIBS += -L$$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/ -llibxml2
    
    INCLUDEPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    DEPENDPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2.lib
    else:win32-g++: PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2_a.lib
    
    OTHER_FILES += \
        include.xml
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/ -llibxml2_a
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/ -llibxml2_a
    
    INCLUDEPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    DEPENDPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    
    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2_a.lib
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2_a.lib
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2_a.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/libxml2_a.lib
    
    win32: LIBS += -L$$PWD/../libxml_win32/libxml2-2.7.8.win32/lib/ -llibxml2_a_dll
    
    INCLUDEPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    DEPENDPATH += $$PWD/../libxml_win32/libxml2-2.7.8.win32/include
    

    i think i have some problems or bad adding of the libs.
    Can someone give me some tips or help? I don't know how to put it runing :S

    thanks in advance,
    ibon

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you have the folder containing your libxml2 dll in your PATH environment variable ? If not, go the Project tab, run settings, and modify it there.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Do you have the folder containing your libxml2 dll in your PATH environment variable ? If not, go the Project tab, run settings, and modify it there.

        I Offline
        I Offline
        IboniuS
        wrote on last edited by IboniuS
        #3

        @SGaist Hello and thanks,

        Yes, I do but it has the same error.

        I have just realized that It doesn't execute the main function, the problem comes when I add the header files of the libxml2 libraries ... why it could be? some problems when linking header files and libraries? :S

        Thanks for all!
        ibon

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Do you mean that if you don't link to libxml2 everything is good and once you link then not anymore ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          0
          • SGaistS SGaist

            Do you mean that if you don't link to libxml2 everything is good and once you link then not anymore ?

            I Offline
            I Offline
            IboniuS
            wrote on last edited by
            #5

            @SGaist Yes, exactly. That means that the precompiled library doesn't work with the qt winmg32? So... I need to compile all the libmx2 to use it with qt? :S

            Thanks,
            Ibon

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Sorry, I've mixed runtime and linking error. Do you know what version of MinGW was used to compile your pre-built libxml2 ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • I Offline
                I Offline
                IboniuS
                wrote on last edited by
                #7

                No, I can't find the version . Maybe I can't use it because was for windows xp and I am using windows 7... I don't know, I give up. :D

                I also was trying to compile libxml2 (libxml++ for using with c++) like library to qt but it is hard.

                I will use QtXmlReader for Windows and then, I will use libxml in embedded linux. I think it will be the best solution.

                Thanks for your time,
                Ibon

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  If you can implement it with QXmlReader then why do a second implementation with libxml2 ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved