Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problem linking qml and xmlpatterns to Zlib for iOS Simulator

Problem linking qml and xmlpatterns to Zlib for iOS Simulator

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 2.1k Views
  • 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
    lucieb
    wrote on 10 Feb 2015, 16:13 last edited by
    #1

    Hello,

    I am in the process of rebuilding Qt for iOS Simulator in order to enable the mysql plugin for iOS.

    Here is my configuration call:
    @./configure -xplatform macx-ios-clang -nomake examples -nomake tests -release -sdk iphonesimulator -plugin-sql-mysql -no-sql-sqlite -static -developer-build -no-ssse3 -v@

    When I get to linking the qml tools (Qt5/qtdeclarative/tools/qml) I get this error:
    @ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/opt/local/lib/libz.1.2.8.dylib' for architecture x86_64@

    However, my zlib located in /opt/local/lib is a universal binary including both i386 and x86_64 architectures:
    libz.1.2.8.dylib: Mach-O universal binary with 2 architectures
    libz.1.2.8.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
    libz.1.2.8.dylib (for architecture i386): Mach-O dynamically linked shared library i386
    libz.1.dylib: Mach-O universal binary with 2 architectures
    libz.1.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
    libz.1.dylib (for architecture i386): Mach-O dynamically linked shared library i386
    libz.a: Mach-O universal binary with 2 architectures
    libz.a (for architecture x86_64): current ar archive random library
    libz.a (for architecture i386): current ar archive random library
    libz.dylib: Mach-O universal binary with 2 architectures
    libz.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
    libz.dylib (for architecture i386): Mach-O dynamically linked shared library i386

    Isn't Qt supposed to link to the static library since I am building for iOS?

    Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lucieb
      wrote on 10 Feb 2015, 16:43 last edited by
      #2

      Sorry, I now realize this post should have gone in the "Mobile and Embedded":http://qt-project.org/forums/viewforum/11/ forum thread.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lucieb
        wrote on 10 Feb 2015, 18:06 last edited by
        #3

        All the modules that had trouble linking to libz.1.2.8.dylib turn out to link properly when pointing to the libz.1.2.5 version in the iPhoneSimulator.sdk (instead of my universal macport build in /opt/local/lib).

        I was able to link the modules properly by changing the occurences of libz.1.2.8.dylib in all the related Xcode projects.

        I'm trying to solve the problem to the source by adjusting the reference in the configuration but I am unable to find where the configuration process selects the wrong libz version.

        Any hints?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Feb 2015, 23:23 last edited by
          #4

          Hi and welcome to devnet,

          Post moved !

          Qt being static doesn't mean that it's not linked to dynamic libraries. Anyhow you can pass -qt-zlib to your configure line to ensure that you are using your Qt zlib version.

          Hope it helps

          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
          • L Offline
            L Offline
            lucieb
            wrote on 11 Feb 2015, 17:06 last edited by
            #5

            I tried the -qt-zlib option but it does not seem to work. The configuration summary still tells me it's using my system library even though I completely cleaned my previous build:

            zlib ................... yes (system library)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 13 Feb 2015, 23:07 last edited by
              #6

              Does it also happen if you use the default set of argument for building ?

              On a side note, I wouldn't build the MySQL plugin, you won't be able to do the same form iOS ARM if it succeed at all for the simulator

              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
              • L Offline
                L Offline
                lucieb
                wrote on 16 Feb 2015, 13:56 last edited by
                #7

                Yes, if I don't specify anything for zlib, it still tells me that it is using the system library.

                I got it to work for iOS and to successfully connect to a local MySQL database. I haven't gone through the process of re-compiling everything for the simulator. Should I keep you posted?

                Another problem I had during compilation was that the instructions to build rcc and uic would not include the -lz flag, I had to add it manually to the command.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 28 Feb 2015, 00:06 last edited by
                  #8

                  Yes please, looks like there's some interference from MacPorts

                  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