Compiling Qt for iOS (UIKit lighthouse) part 2 - ios

I'm trying to compile Qt for the iOS simulator, as explained in this article.
At first I ran into this problem but after it (kinda) solved itself I had some more.
First I kept getting this error after executing the first command, which is supposed to build qmake (../qt/configure ... etc etc):
The OpenGL ES 2.0 functionality test failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /Qt/qt/mkspecs/qpa/macx-iphonesimulator-g++.
Since I knew that I had the 4.3 SDK, I delved into it some more, analyzed the configure script, and after some tracing I saw that the Makefile generated by qmake, required g++-4.2 (which I didn't have), so I just ln -s g++ g++-4.2 and ln -s gcc gcc-4.2 in /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/.
I'm not sure if the aforementioned steps matter, that's why I'm writing about them. Anyway, with that, the configure step was successful. Now I ran make. After some successfully compiled files I got this:
In file included from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WebServicesCore.h:15,
from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:37,
from ../../include/QtCore/private/../../../../qt/src/corelib/kernel/qcore_mac_p.h:83,
from ../../include/QtCore/private/qcore_mac_p.h:1,
from /Qt/qt/src/corelib/tools/qlocale_mac.mm:49:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WSMethodInvocation.h:759:
error: 'CFXMLTreeRef' has not been declared
The same error appears several more times, from several different lines of WebServicesCore.h. So, basically, here's where I'm stuck now.
Any help? Again?...
Edit: Absolutely, 100% the same thing happens when I configure and try to make Qt for the device (as opposed to the simulator)
Additional info:
gcc --version : i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
iOS SDK: I have both 4.3 and 5
OS X version: 10.7.2
Xcode version (if it matters): 4.2.1

Didn't you forget to add -nomake tools and other -nomake ... to your configure ?
Try poking this guys: http://labs.qt.nokia.com/2011/08/09/update-on-uikit-lighthouse-platform/

Related

How to use meson to build glib

I need to upgrade glib for a specific project. It currently uses glib 2.28.8. I have three problems.
I've never used meson and ninja before, so I checked glib's INSTALL.in and it just said to run meson _build followed by ninja -C _build. So I ran meson _build and got the following output:
$ meson _build
The Meson build system
Version: 0.47.2
Source dir: /srv/devel/build/glib-2.65.0
Build dir: /srv/devel/build/glib-2.65.0/_build
Build type: native build
meson.build:227: WARNING: Identifier 'in' will become a reserved keyword in a future release. Please rename it.
meson.build:227:14: ERROR: Expecting eol got id.
if vs_crt_opt in ['mdd', 'mtd']
So the basic build doesn't work. Why?
For our purposes, we use the following configure command:
PKG_CONFIG_PATH=$(OUTPUT_DIR)/lib/pkgconfig ./configure --prefix=$(OUTPUT_DIR) --disable-dtrace --disable-selinux ac_cv_path_MSGFMT=/bin/true CPPFLAGS="-fPIC -I$(OUTPUT_DIR)/include" LDFLAGS="-L$(OUTPUT_DIR)/lib" --enable-static --disable-shared
How do I specify that in meson?
I will also need to build in Windows. Any gotchas there?
Thanks!
EDIT: I tried older versions of glib, going back to 2.62.0 and when I run meson _build I get the error meson.build:1:0: ERROR: Meson version is 0.47.2 but project requires >= 0.49.2.. So that's probably a big part of the problem for question (1). This is running on CentOS 6 & 7, so I'll probably have to get and install a current meson package.
So the basic build doesn't work. Why?
You correctly figured this out in your edit: GLib 2.64 requires Meson 0.49.2, and it seems that Meson 0.47.2 is so old as to not be able to correctly parse GLib’s meson.build.
It looks from your build output that you’re trying to build GLib 2.65.0. Note that 2.65 is an unstable release series. Even minor versions of GLib (2.62.x, 2.64.x, etc.) are stable; odd ones are unstable. Using an unstable release is fine, as long as you know what you’ve signed up for: it may contain bugs, and new APIs introduced in that unstable series may change or be removed before the first stable release (in the case of 2.65.x, the corresponding first stable release will be 2.66.0).
For our purposes, we use the following configure command:
You’ll want something like:
meson --prefix "$(OUTPUT_DIR)" -Dselinux=disabled -Ddefault_library=static _build
You can see from the b_staticpic option’s default value that -fPIC is the default for static libraries, so (I believe) doesn’t need to be explicitly specified.
There should be no need to disable dtrace support since it’s disabled by default. If you did need to disable it, you’d do that with -Ddtrace=false.
The custom -L and -I arguments should be covered by use of --prefix.
Overriding the msgfmt tool to disable internationalisation is not a supported way of building GLib and you’re on your own with that one.
There is some good documentation on the built-in options in Meson here and here.
I will also need to build in Windows. Any gotchas there?
That’s too broad a question to be answered on StackOverflow.

How do I install clang-format without root privileges and without installing LLVM?

I have clang-format version 3.8.0 (tags/RELEASE_380/final) in my ~/bin folder on a Fedora machine with no root privileges. It works, but it is very old and I'd like to upgrade. I just want the clang-format tool, so I would like to avoid going through the full installation process for LLVM or clang if I can avoid it. I assume I can avoid it, since my old clang-format works without either of those installed. I don't remember how clang-format got in my ~/bin directory, and I can't figure out how to update it.
The first thing I tried was following this post which said I should be able to download a prebuilt binary from this page (I tried http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-Fedora27.tar.xz), then just set up a symlink to bin/clang-format. This did not work for me. When I type /path/to/bin/clang-format --help I get the error error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory.
The next thing I tried is downloading the clang source code and compiling that with
mkdir build && cd build && CC=$(which gcc) CXX=$(which g++) cmake ..
but when I did I got the error
CMake Error at CMakeLists.txt:36 (message):
llvm-config not found -- LLVM_CONFIG-NOTFOUND
Which I guess means I'd need to install the LLVM to go this route?
Any help getting an updated clang-format (vesion 5.0 at minimum) without root access would be appreciated. Bonus points for minimal installation (i.e. no clang or llvm).
=== EDIT ===
By downloading a bunch of different versions of prebuilt binaries, I've discovered that older versions (<4.0) have clang-formats that work out of the box, but at 4.0 and up give the same error about libtinfo. I guess that means I'll have to live with older versions unless I want to go through a painful installation process.
When you download llvm 6.0, make sure the directory structure is as follows:
llvm
|-->tools
|----->clang
|----> tools
|----> extra
If you just want to build clang-format, then you can cd into
llvm-build-dir/tools/clang/tools/extra/clang-format and then execute make -j8 all
later you can make a symbolic link in your /bin folder

Gstreamer 1.0 ios sdk installer failed to install

This is my first time trying with Gstreamer for ios , I went with the tutorial and installed the SDK with the link provided by the tutorial:
http://docs.gstreamer.com/display/GstSDK/Installing+for+iOS+development
The installation works fine, but after I start trying the tutorial example projects, there couple of compiling errors compiling about missing gst/video/videooverlay.h . Then I looked into the header folder under the installed GStreamer header folder, there is no filed called video/videooverlay.h
Then I search online, found this information:
Gstreamer for iOS provided is out of date. I used the freedesktop packages
from https://github.com/braincorp/gstreamer_ios_tutorial
Then I downloaded another installation pkg for GStreamer
Then while I was trying to install the later version, the installer give me error saying:
you cannot install GStreamer 1.0 (Development Files) in this location.
Then I thought I might need to uninstall the previous version, but I couldn't finder a standard uninstallation option from the installer, then I searched online, find one post suggest remove the GStreamer folder under ~/Library/Developer
I have removed the installed folder, so I don't have any header files, but the new installer still gives the same error
I have been trying to figure this out for sometime, couldn't find useful info on line , I really appreicate any clue and help you might have!
Thanks!!
Jing
Answering my own question here..
not sure what's the issue, after restarting my mac, and run the installer couple of times with the same error, it suddenly worked ....... i am not sure what's the matter here, hope gstreamer team can improve the stability of the installer in the future.
At work we are currently trying to get the IOS tutorials from the streamer 1.0 sdk to run.
1) Compilation: Same thing: we managed to bootstrap (cerbero ... bootstrap) and compile (cerebra ... package streamer-sdk) using the official cerebero git repository.
But:
a) We had to mock around with the /cerbero/cerbero/enums.py file:
Add in the collection of supported old IOS (6.0, 6.1, 7.0, etc...) the one corresponding to our Xcode version : IOS 8.4
b) We had to customize the /cerbero/config/ios.config and iOS-universal.config files to get them to use the right architecture in our case: arm7v or arm7 instead of X64_86 or x86
c) We removed the not found is_asm() function from the x264 plugin's recipe file in the /cerbero/recipes.
For a reason we ignore, for all other platforms but IOS, the recipes check on the architecture available using:
if self.config.target_arch == Architecture.xxx:
of iOS is was using that missing function: is_asm(self.config.target_arch)
We replaced it by:
if self.config.target_arch == Architecture.ARMv7:
Compiling an iOS app using streamer:
So far it is a failure. we bumped into the same missing overlay.h header file. We couldn't find it anywhere.
DIFFERENCE between gstreamer.com (the sdk provider) and the official streamer website (free desktop.gsteamer.org):
We found out that gstreamer.com is clearly a commercial goal company that is making available the sdk, that people struggle on with for IOS (tested and working fine on linux) and the official website is providing the gstreamer library only without an sdk.
So this is what we are trying to use instead as of today.
Versions infos:
sdk (from gstreamer.com): current cerbero git master branch: git clone git://anongit.freedesktop.org/gstreamer-sdk/cerbero
official gstreamer library:
http://gstreamer.freedesktop.org/data/pkg/ios/1.5.2/

How to build opencv_contrib module for iOS

I want to use some function in the newly introduced opencv_contrib modules on iOS, how can I build a iOS framework with those extra modules. Thanks in advance.
I am answering this (old) question for the benefit of other developers who would like to try this on newer OpenCV versions.
It is possible to build opencv_contrib modules together with the iOS framework, in version 4 (current at the time of answering).
set path to the Xcode command line tools:
sudo ln -s /Applications/Xcode.app/Contents/Developer Developer
cd to the path above the opencv directory
cd ~/
Build the framework with the --contrib option:
python opencv/platforms/ios/build_framework.py --contrib <'relative_path_to_opencv_contrib'>/opencv_contrib/ ios
If an individual module does not get build, you should check the CMakelists.txt of that module to see if it has been disabled for iOS.
I just tested this before answering, so feel free to drop a comment or a question if there are issues.
See fficial document tutorial_ios_install!
This works well.
The official document does not include building iOS framework with opencv_contrib.
But inferring from the cmake file, you can copy the module you want (ximgproc in your case) to opencv/modules. Then run build_framework.py as usual.
You can checkout this post

Command line tools download in Xcode disappeared after Mavericks

After having installed Mavericks I got this problem on a code that compiled without problems before.
xcode-select --install triggers the installation without any strange problems,
yet when I try to build something with Eclipse it gives me
"Include path not found (/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include)"
Infact in /Applications/Xcode.app/Contents/Developer/usr/ there's no llvm-gcc-4.2.
How can I fix this?
On my system in terminal:
/usr/bin/llvm-gcc-4.2
produces:
/usr/bin/llvm-gcc-4.2
/usr/bin/llvm-gcc-4.2
is linked to :
/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
Also
$ which llvm-gcc
produces:
/usr/bin/llvm-gcc
and
/usr/bin/llvm-gcc is linked to /usr/bin/clang
Note that Apple no longer provides llvm-gcc as an option in Xcode so perhaps it is no longer supplied as a command-line tool.
I had problems with the command line tools as well after upgrading to Mavericks, despite having updated Xcode, and I am quite sure I also installed the command line tools. Still, you can add them "by hand" downloading from apple site. I am not sure if it is any sort of bug of such, but anyway, I recommend you to download the latest Mavericks' Command Line Tools (late October) on Apple's developer site (needs free registration)

Resources