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 with Qt project under wine
Forum Updated to NodeBB v4.3 + New Features

Libxml2 with Qt project under wine

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.4k 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.
  • H Offline
    H Offline
    heatblazer
    wrote on last edited by
    #1

    Hello, I am trying to include libxml from http://xmlsoft.org/downloads.html here, and use it in my qt project, I`ve placed the folder of libxml2 in my wine drive then in qt project I did:
    @
    win32 {
    message("*using settings for windows")
    INCLUDEPATH += "Z:\home\ilian\.wine\drive_c\Qt\Qt5.3.1\Tools\mingw482_32\i686-w64-mingw32\include"
    "Z:\home\ilian\.wine\drive_c\libxml2\include\libxml"

    LIBS += -L "Z:\\home\\ilian\\.wine\\drive_c\\Qt/Qt5.3.1\\Tools\\mingw482_32\\i686-w64-mingw32\\include\\windows.h" \
    "Z:\\home\\ilian\\.wine\\drive_c\\libxml2\\include\\libxml\\xmlversion.h" \
    "Z:\\home\\ilian\\.wine\\drive_c\\libxml2\\include\\libxml\\xmlexports.h" \
    "Z:\\home\\ilian\\.wine\\drive_c\\libxml2\\include\\libxml\\xmlreader.h" \
    "Z:\\home\\ilian\\.wine\\drive_c\\libxml2\\include\\libxml\\tree.h" \
    

    @

    It does not work the error is:
    @
    Z:\home\ilian.wine\drive_c\libxml2\include\libxml\xmlversion.h:13: error: libxml/xmlexports.h: No such file or directory
    #include <libxml/xmlexports.h>
    ^
    Z:\home\ilian.wine\drive_c\libxml2\include\libxml\xmlreader.h:13: error: libxml/xmlversion.h: No such file or directory
    #include <libxml/xmlversion.h>
    ^
    Z:\home\ilian.wine\drive_c\libxml2\include\libxml\tree.h:16: error: libxml/xmlversion.h: No such file or directory
    #include <libxml/xmlversion.h>
    ^
    @

    Can you tell me how to fix it?

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

      Hi,

      Just remove libxml from "Z:\home\ilian\.wine\drive_c\libxml2\include\libxml"

      Also your LIBS line doesn't make sense. -L is to tell the linker where to look to find libraries so it should be followed by a folder.

      Note that with Qt you can (and should) use only forward slashes for path even on windows.

      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
      • H Offline
        H Offline
        heatblazer
        wrote on last edited by
        #3

        Forward slashes... I noticed it but now that you mention, I`ll take note. I am learning Qt on the fly while working so I am treating myself as a noob yet :)
        [quote author="SGaist" date="1412848291"]Hi,

        Just remove libxml from "Z:\home\ilian\.wine\drive_c\libxml2\include\libxml"

        Also your LIBS line doesn't make sense. -L is to tell the linker where to look to find libraries so it should be followed by a folder.

        Note that with Qt you can (and should) use only forward slashes for path even on windows.[/quote]

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

          Did you got the rest working ?

          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
          • H Offline
            H Offline
            heatblazer
            wrote on last edited by
            #5

            It`s perfect for linux compile/run but for windows I still get the undefined references. Here is the .pro file:
            @
            win32 {
            message("*using settings for windows")
            INCLUDEPATH += "Z:\home\ilian\.wine\drive_c\Qt\Qt5.3.1\Tools\mingw482_32\i686-w64-mingw32\include"
            INCLUDEPATH += "Z:\home\ilian\.wine\drive_c\libxml2\include"
            }
            @

            I know about the slashes, I just keep these because the INCLUDEPATH for mingw... windows.h is working ( the first one ).

            The file I am using libxml is as follows ( it`s small so I am c/p the whole):
            @
            #ifndef XMLTEST_H
            #define XMLTEST_H
            #ifdef gnu_linux
            #include <libxml2/libxml/parser.h>
            #include <libxml2/libxml/tree.h>
            #include <libxml2/libxml/xmlversion.h>
            #include <libxml2/libxml/xmlexports.h>
            #include <libxml2/libxml/xmlreader.h>
            #include <stdio.h>
            #else
            #include <libxml2/include/libxml/parser.h>
            #include <libxml2/include/libxml/tree.h>
            #include <libxml2/include/libxml/xmlversion.h>
            #include <libxml2/include/libxml/xmlexports.h>
            #include <libxml2/include/libxml/xmlreader.h>
            #include <stdio.h>
            #endif

            #include "DList.h"
            /* read the XML file from args then return it as DList,
            call DList passToDaemonArgvs() to return char** /
            DList
            main_xml(int, char**);

            void parseDirectoryAddToList(DList*, xmlDocPtr, xmlNodePtr);

            #endif // XMLTEST_H
            @
            Still can`t get why this is not working... the windows.h was success including and building, but libxml?

            [quote author="SGaist" date="1412980151"]Did you got the rest working ?[/quote]

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

              From your win32 scope I don't see anywhere where you give the path to find the libxml2 libraries.
              You need to add something like

              @LIBS += -L/Path/to/where/libxml2/windows/libfiles/can/be/found@

              or using double backslashes

              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