Problem linking qml and xmlpatterns to Zlib for iOS Simulator
-
wrote on 10 Feb 2015, 16:13 last edited by
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 i386Isn't Qt supposed to link to the static library since I am building for iOS?
Thanks!
-
wrote on 10 Feb 2015, 16:43 last edited by
Sorry, I now realize this post should have gone in the "Mobile and Embedded":http://qt-project.org/forums/viewforum/11/ forum thread.
-
wrote on 10 Feb 2015, 18:06 last edited by
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?
-
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
-
wrote on 11 Feb 2015, 17:06 last edited by
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)
-
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
-
wrote on 16 Feb 2015, 13:56 last edited by
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.
-
Yes please, looks like there's some interference from MacPorts