Compile Sofia-SIP for iOS - ios

I am trying to compile Sofia-SIP library for iOS for architectures armv6 and armv7 but I am running into problems. Below is what I am doing.
export DEVROOT=/Applications/Xcode_4_6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS6.1.sdk
export CC=$SDKROOT/usr/bin/llvm-gcc-4.2
export CFLAGS="-pipe -no-cpp-precomp -isysroot $SDKROOT -arch armv7"
export LDFLAGS="-syslibroot $SDKROOT -arch armv7"
export CPP=$SDKROOT/usr/bin/llvm-g++-4.2./configure --host=arm-apple-darwin10
sudo ./configure --host=arm-apple-darwin10
RESULT
Password:
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... arm-apple-darwin10
checking target system type... arm-apple-darwin10
checking cached information... ok
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-apple-darwin10-strip... no
checking for strip... strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for arm-apple-darwin10-gcc... no
checking for gcc... gcc
checking for arm-apple-darwin10-gcc... gcc
checking whether the C compiler works... yes
PROBLEM
I want the script to use llvm-gcc compiler. But instead it is looking for arm-apple-darwin10-gcc which it could not find and then finally ends up using gcc compiler.

I fought with this for a weekend, won the battle (with a lot of help), and have the following to return to the community:
Regarding su_os_nw.c and the
SCDynamicStore: function has been explicitly marked unavailable for iOS
issue:
I was about to give up, but noticed that a fellow named Antonis Tsakirids from Restcomm reported success in integrating Sofia in their iOS SDK.
I then went to their git repository and had a look at their SDK.
In /dependencies/sofia-sip/libsofia-sip-ua/su/ I found the culprit: su_os_nw.c
They elegantly updated
#if defined (__APPLE_CC__)
to
#if defined (__APPLE_CC__) && !defined(TARGET_OS_IPHONE)
This solves it…
…but it does not solve it just by itself…because apparently since Xcode 7, Apple did some toolchain utilities shuffling.
Stuff is not located in “usual” locations anylonger, and MishaBruckman’s $DEVROOT got obsolete.
For instance , I got errors about “ar” not being found.
export DEVROOT="$(xcrun --sdk iphoneos --show-sdk-platform-path)/Developer”
maps to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
However, the toolchain utilities (ld, ar, as, nm, ranlib, along with the almighty clang) have been moved to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin.
I bolded the part that should map to the new $DEVROOT.
Hope this helps someone save 2 weekend days of their life...
…and in the end, the 2 points expressed above were not enough to get out of the woods…Compilation did finish OK and I left it at that initially.
However, today I wanted to actually use the library. Created a new project, imported the library, hit Build and…more suffering…
libsofia-sip-ua.a does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target for architecture armv7.
At first I went “say wha’…?”
what’s this mumbo_jumbo about setting stuff in Xcode? I did things the old_school way, compiling in command line…
what do you mean “obtain an updated library from the vendor”…the “vendor” is me, I’m building the library…
what is this strange bitcode thing, anyway?
After doing my homework regarding bitcode I started wondering what hides behind Xcode’s ENABLE_BITCODE… Turns out it “means” passing the “-fembed-bitcode” flag to clang.
In conclusion, the line
export CFLAGS="-arch ${ARM_ARCH} -mios-version-min=7 -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${SDKROOT}/usr/include/"
became
export CFLAGS="-arch ${ARM_ARCH} -mios-version-min=7 -fembed-bitcode -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${SDKROOT}/usr/include/"
Rebuilt Sofia with the new settings, but then it started complaining that even though the main project itself is going ok, it's SUB-LIBRARIES (for example libstun.a) are not compiled with bitcode. A "make clean" got rid of the old garbage and compilation finished ok. Imported the newly produced lib into my Xcode project and everything was ok as well.
And that finally concludes it. Build successful for a project under Xcode 7 / iOS9 integrating Sofia library, in anno domini 2015…
...aaaand...I was still not out of the woods...
As soon I decided to add arm64 architecture to my project, Xcode started again to complain about Sofia:
ignoring file libsofia-sip-ua.a, file was built for archive which is not the architecture being linked (arm64)
Undefined symbols for architecture arm64
Pretty simple, I thought: I'll just replace armv7 with arm64:
export ARM_ARCH="arm64”
After that modification, disaster struck while ./configure-ing:
checking for gcc... /usr/bin/clang
checking for gcc... (cached) /usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/work/fromSourceforge/sofia-sip-1.12.11':
configure: error: C compiler cannot create executables
See `config.log' for more details
The next day was spent figuring out what was wrong (I could not ./configure anylonger, even reverting back to armv7)
stormed stack overflow; no solution helped
checked ad re-checked every path on the system...I was surprised to find out that one can find clang and gcc in 3-4 places throughout macosx, but I digress...
trying to reinstall Xcode Developer Tools
ended up reinstalling Xcode itself...
...nothing helped.
An eagle-eyed colleague spotted what was wrong:
export ARM_ARCH="arm64”
The last quote sign was not "the same" as the first quote sign. The first quote sign is "the correct kind of quote sign".
Even if I didn't touch the second one with my own hand, TextEdit changed it all by itself while I was converting v7 to 64. Apparently it's "a feature", called SmartQuotes. I could not disable it, by the way.
Mental note: NEVER EVER use TextEdit again to edit the .bash_profile file.
Finally, I found myself in the posession of the 64 bit version of Sofia. Plugged it into my Xcode project, aaaaaaand....
ignoring file libsofia-sip-ua.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7
Hmmm...if I build it for 32 bits, it complains about 64 missing...If I build it for 64 bits, it complains about 32 missing...
Turns out there's a way to fuse together multiple libraries into a single "fat" one.
The utility is called lipo and you use it something like this:
lipo -create "path_to_lib_1" "path_to_lib2" -output "path_to_desired_name_of_the_merged_library"
So: SIP-ing along with Sofia, under iOS, as a single library that does both 32 and 64 bits...
Heewhhh...
.....aaaaaaaaand we're still not done...!
Problem: trying to do anything (REGISTER, for instance) promptly resulted in a 503 DNS Error
Cause : Sofia searches for the name servers list in etc/resolv.conf
Obviously, this being iOS, it either does not exist, OR it's outside of the app sandbox.
Solution : it's the second time when this guy, Antonis Tsakiridis, saves my ass. Respectful bow.
First, he talks about what he intends to do.
Second, he shows what he has actually done.
However, the solution exposes a new...
Problem: _res_9_init - undefined symbol for architecture (armv7 or arm64 here, depending on what I happened to have set for ARM_ARCH), while recompiling Sofia
Cause : I don't know. I can only infer from the solution, that the linker needed to be told about the "resolv" library
Solution : added -lresolv in two places:
LDFLAGS (in the .bash_profile file)
in the Xcode "application" project (the one that exercises the library); Targets ---> Linking ---> OtherLinkerFlags
Just like before, although the above solves what it was trying to solve, it also advances us to the next...
Problem: conditional execution of code under #IOS_BUILD (part of AT's solution at first problem) did not take place. Still getting 503 DNS Error...
Cause : I could not figure out for the life of me WHERE IT'S ACTUALLY DEFINED. Of course, defining it anywhere in my own code could have no effect, since Sofia is supposed to be an already compiled dependency; we don't get another chance at the preprocessor crunching through her code.
Solution: I replaced the IOS_BUID #define with an environment variable called IOS_BUILD that has the value...well...IOS_BUILD. I told Xcode about it (I'm trying to use not the word "define" to avoid confusion) at
Product ---> Scheme ---> EditScheme ---> Arguments ---> EnvironmentVariables.
In Sofia, I just substituted #Ifdef IOS_BUILD with calls to getenv() and strcmp().
After all that, behold...REGISTER takes place...
Also, DNS settings are correctly detected everytime I connect the iPhone to another wi-fi, thanks to Sofia's smart "resolver".

Note that llvm-gcc is deprecated; you should be using clang instead:
% ls -l /usr/bin/llvm-gcc
lrwxr-xr-x 1 root wheel 5 Nov 8 2013 /usr/bin/llvm-gcc# -> clang
The following seems to work for me:
export DEVROOT="$(xcrun --sdk iphoneos --show-sdk-platform-path)/Developer"
export SDKROOT="$(xcrun --sdk iphoneos --show-sdk-path)"
export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
export LD="${DEVROOT}/usr/bin/ld"
export AR="${DEVROOT}/usr/bin/ar"
export AS="${DEVROOT}/usr/bin/as"
export NM="${DEVROOT}/usr/bin/nm"
export RANLIB="${DEVROOT}/usr/bin/ranlib"
export LDFLAGS="-L${SDKROOT}/usr/lib/"
export ARM_ARCH="armv7" # or "armv6" and adjust the --host=[...] flag below
export CFLAGS="-arch ${ARM_ARCH} -pipe -no-cpp-precomp -isysroot ${SDKROOT} -I${SDKROOT}/usr/include/"
export CPPFLAGS="${CFLAGS}"
export CXXFLAGS="${CFLAGS}"
Configure:
./configure --host=armv7-apple-darwin
Build:
make
Verify:
file `find . -name \*dylib`
Output:
./libsofia-sip-ua/.libs/libsofia-sip-ua.0.dylib: Mach-O dynamically linked shared library arm
./libsofia-sip-ua/.libs/libsofia-sip-ua.0.dylib.dSYM/Contents/Resources/DWARF/libsofia-sip-ua.0.dylib: Mach-O dSYM companion file arm
./libsofia-sip-ua/.libs/libsofia-sip-ua.dylib: Mach-O dynamically linked shared library arm
Credits:
most flags above were adapted from this question
xcrun command via a comment by Alex Denisov on this page
Notes:
I dropped the -miphoneos-version-min=[...] flag from the other question as I did not think it was relevant to your question; up to you if you want to add it back into CFLAGS.

Related

I'm getting an error "Undefined symbols for architecture x86_64" and can't find the error in compilation

This is what my files look like
My main function is here
I compiled it using the following command:
g++ -std=c++17 main.cpp linkedList.cpp -o main
on MacOS 10.14 using the latest gcc compiler as of 2018.
It looks like the definitions for your template are not visible to the compiler when it is instantiated. You need to move the definitions from linkedList.cpp into the header file, linkedList.hpp.
(Note that C++17 support is still experimental in GCC.)

Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation))

I am working on a project that was previously done and uploaded on app store.When I run this app in Xcode 5.0 it is working fine but when I run this on Xcode Version 5.1.1 (5B1008) I am getting Linker error on both device and simulator.
Error Message- Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation)).
I have searched a lot but I didn't get any thread about Library not found for -llib error. Is there anything I have to change in build settings to resolve this?
Look at the linker command line in detail for the -L options being used:
Then use Terminal or Finder to see if your libXXX.a file exists in those directories. If the library exists elsewhere then you need to configure your Library Search Paths:
However there several details which you have not provided in your question when using a library within an app:
Is the library built as part of the Xcode project/workspace (as in the first image)?
Is the library supplied by a third-party with binary (.a) and header files (as in the second image)?
TL;DR: I ran make in the wrong directory so the paths were messed up.
Problem:
>make
linking ../build/release/yubikey-personalization-gui
/usr/x86_64-suse-linux/bin/ld: cannot find -llib
...
I ran into this when compiling the Yubikey Personalisation Tool. I tracked down the -llib call in my Makefile which looked like this:
...
LINK = #echo linking $# && g++
...
LIBS = $(SUBLIBS) -L/usr/lib64 -L../lib/release -llib -lyubikey -lykpers-1 -lQtGui -L/usr/lib64 -L/usr/X11R6/lib -lQtCore -lpthread
...
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
So it was setting a variable called LINK which would print "linking" and then call g++, which is the compiler.
Then it set the var LIBS which would hold the ominous -llib.
Then it composes and runs the command $(LINK) ... $(LIBS).
Which runs g++ with the parameter -llib.
And what does that do? Turns out -l<something> is telling the compiler to use the something-library. So it asks for the library called lib here. Which is strangely generic. I figured out that the sources came with a directory called lib/, which was at ../lib.
So starting make from a directory higher up fixed it.
You should remove libstdc++ from other linker flags in your xcode project
https://stackoverflow.com/a/53103383/1344237

Apple LLVM 6.0 Error

I recently downloaded and installed the XCode6-Beta and I am getting this build error. Steps already taken:
Double checked my prefix header file.
Cleaned project.
Restarted XCode.
Deleted DerivedData like 100 times!
Any thing I may be missing?
Command
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
failed with exit code 1
EDIT:
Temporary Solution.
I removed the 6.0 support which was one of the areas causing problem however, if you need support for earlier versions this will still be an issue.
Ther is one way!
Select Targets/Build Settings/ Scroll to Apple LLVM 6.0 - Preprocessing
-> ENABLE FOUNDATION ASSERTIONS set it to NO
The problem is, Xcode is not telling you the actual error that clang (LLVM) is throwing; it's just saying that clang process exited with code 1, meaning an error.
To find out exactly what the error is requires a bit of digging...
I don't have Xcode6, but this how it can be done in Xcode 5, and it's probably pretty similar:
If you open the "Logs Navigator" (View-->Navigators-->Logs Navigator or cmd-8) and click on "Build", you should be able to see the build that you just ran. Clicking on the three lines on the side will bring up the full command that was run and the output it gave.
You might be able to see your error here, but if not, you can do one better:
Copy and paste the command (it will be HUGE) from the window into a terminal and run it! You should look something like this:
CompileC /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o Misc/template_tests.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Daly/Documents/School/EECS/Labs/Misc/Misc
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.8 -g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-generated-files.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-own-target-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-all-target-headers.hmap -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-project-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources/x86_64 -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources -F/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug -MMD -MT dependencies -MF /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.d --serialize-diagnostics /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.dia -c /Users/Daly/Documents/School/EECS/Labs/Misc/Misc/Misc/template_tests.cpp -o /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o
(This is from one of my projects.) You can skip the first line (CompileC .... 1_0.compiler), but copy the rest and paste it into a terminal!
Hopefully this lets you see the error and we can work from there (probably in a new question)!
This happened to me when I renamed my project.
To solve this, Select Targets/Build Settings and search for the old project name and replace with the new name.
I got the same error, but what causing it was some missing classes library.
then i added them again to the project but still causing the error.
after i searched it in the build phase, those class that had been missing is still linked to the project, so all i did is to remove those class that been highlighted red.
clean the project, and then build it.
for me, it worked
Final solution:
Try to delete the appTests like here here:
https://www.dropbox.com/s/j9s6nycb58x3nzs/target_tests.png?dl=0
Credits for this answer:
Apple LLVM 6.0 Error: clang failed with exit code -1
This example worked for me. Follow this link if you want to do it with the screen shots. Otherwise here are the steps:
STEP 1: From the menu bar of xcode select > window > organizer
STEP 2: The new window will open, copy the derived data address till /derivedData e.g. ~/Library/Developer/Xcode/DerivedData/
STEP 3: Quit xCode
STEP 4: Double click/tap on finder and select "Go to Folder"
STEP 5: Paste the copied address in the text field
STEP 6: The folder that will open delete every single file and folder you see in it.
STEP 7: Empty your trash and open xCode again and run the project.
It worked for me.
Temporary Solution.
I removed the 6.0 support which was one of the areas causing problem and that seemed to have fixed it. However, if you need support for earlier versions this will still be an issue.
There might be trouble at the prefix.pch file, make sure you also double check your prefix.pch for any code that might be from the previous os version. If you dont't need the pre-compilation set it to NO by going to TARGETS > PreCompile Prefix Headers and selecting NO. You may then need to manually import the frameworks/file to every class file you make.
EDIT
If you do a hard cleaning cmd + product > clean. You will see an option 'Clean Build Folder..'. Using that sometimes removes the issue. If that still doesn't work reinstall the xcode6 and it will work(since you already have the downloaded dmg setup, it will take 2min only)
I was able to resolve this error by changing the 'Build Settings -> iOS Deployment Target' value to a more recent iOS version.
I was trying to use openMP on XCode-9 on Mac-OS Sierra 10.13.4 and I followed these steps : [http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/][1]
I have the error like this :
clang-6.0: error: cannot specify -o when generating multiple output
files
I fix that problem by changing some settings in XCode:
In build settings > build options > Enable Index-While-Building Functionality to No
This problem might occur when the project library looses its reference due to some condition.Go to --> Library -->Developer --> Xcode -->DerivedData .Now delete the "DerivedData" folder.Clean and run your project. This solves the issue. Hope this helps
Such a problem may occur if you change some Cocoa header by an accident. The compiler will ask you to rebuild precompiled headers (in my case it did so), but the actual error will be different. To make the compiler show you a real error set ENABLE FOUNDATION ASSERTIONS to NO (it's described above), so, you'll find out which header caused failure.
You need to change the Development target .... it works for me

How to build ohNet for iOS?

I am trying to build the ohNet UPnP stack from openhome.org for execution on the iPhone and iPhoneSimulator. I have seen in various places on the web that there is a port to iOS, and indeed there is some reference to iOS building in the Makefile. After some editing of the $DEVROOT and $SDKROOT paths, I can compile many of the sources, but the build halts with error at:
g++ -pthread -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/ -arch armv6 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/system -shared -shared-libgcc -o Build/Obj/Mac/arm/Release/libohNet.dylib Build/Obj/Mac/arm/Release/Ascii.o Build/Obj/Mac/arm/Release/AsyncC.o Build/Obj/Mac/arm/Release/AsyncPrivate.o Build/Obj/Mac/arm/Release/Bonjour.o Build/Obj/Mac/arm/Release/Buffer.o Build/Obj/Mac/arm/Release/Discovery.o Build/Obj/Mac/arm/Release/Debug.o Build/Obj/Mac/arm/Release/Converter.o Build/Obj/Mac/arm/Release/CpDeviceCore.o Build/Obj/Mac/arm/Release/CpDeviceC.o Build/Obj/Mac/arm/Release/CpDeviceStd.o Build/Obj/Mac/arm/Release/CpDeviceDvCore.o Build/Obj/Mac/arm/Release/CpDeviceDvStd.o Build/Obj/Mac/arm/Release/CpDeviceDvC.o Build/Obj/Mac/arm/Release/CpDeviceUpnpCore.o Build/Obj/Mac/arm/Release/CpDeviceUpnpC.o Build/Obj/Mac/arm/Release/CpDeviceUpnpStd.o Build/Obj/Mac/arm/Release/CpiDevice.o Build/Obj/Mac/arm/Release/CpiDeviceDv.o Build/Obj/Mac/arm/Release/CpiDeviceUpnp.o Build/Obj/Mac/arm/Release/CpiService.o Build/Obj/Mac/arm/Release/CpiStack.o Build/Obj/Mac/arm/Release/CpiSubscription.o Build/Obj/Mac/arm/Release/CpProxy.o Build/Obj/Mac/arm/Release/CpProxyC.o Build/Obj/Mac/arm/Release/CpServiceC.o Build/Obj/Mac/arm/Release/DvDevice.o Build/Obj/Mac/arm/Release/DvDeviceStd.o Build/Obj/Mac/arm/Release/DvDeviceC.o Build/Obj/Mac/arm/Release/DviDevice.o Build/Obj/Mac/arm/Release/DvInvocationC.o Build/Obj/Mac/arm/Release/DvInvocationStd.o Build/Obj/Mac/arm/Release/DviProtocolUpnp.o Build/Obj/Mac/arm/Release/DviProviderSubscriptionLongPoll.o Build/Obj/Mac/arm/Release/DvOpenhomeOrgSubscriptionLongPoll1.o Build/Obj/Mac/arm/Release/DviServer.o Build/Obj/Mac/arm/Release/DviServerUpnp.o Build/Obj/Mac/arm/Release/DviServerWebSocket.o Build/Obj/Mac/arm/Release/DviService.o Build/Obj/Mac/arm/Release/DviStack.o Build/Obj/Mac/arm/Release/DviSubscription.o Build/Obj/Mac/arm/Release/DviPropertyUpdateCollection.o Build/Obj/Mac/arm/Release/DvProvider.o Build/Obj/Mac/arm/Release/DvProviderC.o Build/Obj/Mac/arm/Release/DvServerUpnp.o Build/Obj/Mac/arm/Release/DvServerUpnpC.o Build/Obj/Mac/arm/Release/DeviceXml.o Build/Obj/Mac/arm/Release/Error.o Build/Obj/Mac/arm/Release/EventUpnp.o Build/Obj/Mac/arm/Release/Exception.o Build/Obj/Mac/arm/Release/Fifo.o Build/Obj/Mac/arm/Release/Http.o Build/Obj/Mac/arm/Release/DNSCommon.o Build/Obj/Mac/arm/Release/DNSDigest.o Build/Obj/Mac/arm/Release/mDNS.o Build/Obj/Mac/arm/Release/uDNS.o Build/Obj/Mac/arm/Release/MdnsPlatform.o Build/Obj/Mac/arm/Release/MdnsProvider.o Build/Obj/Mac/arm/Release/Maths.o Build/Obj/Mac/arm/Release/Md5.o Build/Obj/Mac/arm/Release/NetworkAdapterList.o Build/Obj/Mac/arm/Release/Network.o Build/Obj/Mac/arm/Release/Parser.o Build/Obj/Mac/arm/Release/Printer.o Build/Obj/Mac/arm/Release/ProtocolUpnp.o Build/Obj/Mac/arm/Release/Queue.o Build/Obj/Mac/arm/Release/RefCounter.o Build/Obj/Mac/arm/Release/Service.o Build/Obj/Mac/arm/Release/ServiceC.o Build/Obj/Mac/arm/Release/sha1.o Build/Obj/Mac/arm/Release/Ssdp.o Build/Obj/Mac/arm/Release/SsdpDv.o Build/Obj/Mac/arm/Release/Stack.o Build/Obj/Mac/arm/Release/Stream.o Build/Obj/Mac/arm/Release/Subscription.o Build/Obj/Mac/arm/Release/Thread.o Build/Obj/Mac/arm/Release/Timer.o Build/Obj/Mac/arm/Release/Uri.o Build/Obj/Mac/arm/Release/XmlParser.o Build/Obj/Mac/arm/Release/XmlFetcher.o Build/Obj/Mac/arm/Release/OhNet.o Build/Obj/Mac/arm/Release/OhNetCp.o Build/Obj/Mac/arm/Release/OhNetDv.o Build/Obj/Mac/arm/Release/OhNetCombined.o Build/Obj/Mac/arm/Release/OhNetC.o Build/Obj/Mac/arm/Release/OhNetCCp.o Build/Obj/Mac/arm/Release/OhNetCDv.o Build/Obj/Mac/arm/Release/OhNetCCombined.o Build/Obj/Mac/arm/Release/OsWrapper.o Build/Obj/Mac/arm/Release/Os.o
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
make: *** [ohNetDll] Error 255
I cannot understand why the build process wants to build ohNetDll for this platform, nor how to opt out of that section/target. Dynamic libraries are not supported for iOS Apps and certainly not dlls which are native to Windows.
If you have built/ported/used ohNet on iOS can you please advise how to do it? I wanted to post this question on the ohNet forum, but I am unable to register (because I haven't submitted a security question even though there is nowhere to do so on the form!).
The source, documentation and API guide all look very promising for ohNet, so I am hoping you can advise...
"After some editing of the $DEVROOT and $SDKROOT paths, I can compile
many of the sources..."
For iPhoneOS Platform, set the following environment variables.
export ROOTDIR="/Applications/Xcode.app/Contents/Developer"
export PLATFORM="iPhoneOS"
export MAX_VERSION="5.1"
export DEVROOT=${ROOTDIR}/Platforms/${PLATFORM}.platform/Developer
export SDKROOT=${DEVROOT}/SDKs/${PLATFORM}${MAX_VERSION}.sdk
Then, in the root directory of the source, in the file "Makefile", locate the following section and ensure it looks the same as this one:
ifeq ($(MACHINE), Darwin)
ifeq ($(mac-arm),1)
# Darwin, ARM -> iOS
platform ?= iOS
linkopts_ohNet =
devroot=$(DEVROOT)
sdkroot=$(SDKROOT)
platform_cflags = -I$(sdkroot)/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I$(sdkroot)/usr/include/ -I/usr/bin/arm-apple-darwin10-gcc -miphoneos-version-min=2.2 -pipe -no-cpp-precomp -isysroot $(sdkroot) -DPLATFORM_MACOSX_GNU -DPLATFORM_IOS -I$(sdkroot)/usr/include/c++/4.2.1/armv6-apple-darwin10/
# It seems a bit weird that iOS uses a sub-dir of Build/Obj/Mac, is that deliberate? --AW
osbuilddir = Mac/arm
objdir = Build/Obj/Mac/arm/$(build_dir)/
platform_linkflags = -L$(sdkroot)/usr/lib/ -arch armv7 -L$(sdkroot)/usr/lib/system
compiler = $(devroot)/usr/bin/llvm-gcc-4.2 -arch armv7 -isysroot $(SDKROOT) -o $(objdir)
# No support for linking Shared Objects for ARM MAC
# link = $(devroot)/usr/bin/llvm-gcc-4.2 -pthread -Wl $(platform_linkflags)
ar = $(devroot)/usr/bin/ar rc $(objdir)
native_only = yes
The key points here are:
The $DEVROOT and $SDKROOT are correct for your version of the iOS SDK.
The variable $native_only is set to yes. This avoids error and early exit when make tries (and inevitably fails) to build ohNetDll on the Mac host machine.
Then, in a terminal, in the source root directory (i.e the one containing Makefile) type:
make mac-arm=1
Hope this helps...
Doug

Compiling Qt for iOS (UIKit lighthouse)

I've been trying to compile Qt for iOS, but I've been having some crazy problems that noone else seems to be having (at least according to what I read in the past day).
I followed the instructions from this article:article url
I cloned a the latest Qt 4.8 from git: $ git clone git://gitorious.org/qt/qt.git
I made the qt-lighthouse-ios-simulator folder, cd to it.
I ran the long line of code from the article: $ ../qt/configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations
opensource license
yes I accept the agreement
I get these errors:
In file included from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h:13,
from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h:49,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:34,
from generators/mac/pbuilder_pbx.cpp:56:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65: error: CGCharCode has not been declared
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65: error: CGKeyCode has not been declared
After struggling with this, searching here and there, and finding nothing useful (even nothing about what CGKeyCode or CGCharCode actually are, I decided to "hack" it and just added the definitions to pbuilder_pbx.cpp:
typedef u_int16_t CGCharCode; /* Character represented by event, if any */
typedef u_int16_t CGKeyCode; /* Virtual keycode for event */
Then another file couldn't compile, with the same errors. After adding them to a couple of files, I eventually added them to qcore_mac_p.h, then some files complained that they didn't know what u_int16_t was, so I added
typedef unsigned short u_int16_t; /* compile, god damn you!!! */
to the same header.
Now everything compiled but there was this linker error:
ld: in /System/Library/Frameworks//CoreGraphics.framework/CoreGraphics, missing required architecture x86_64 in file for architecture x86_64
Here's where I'm stuck. Any help?
Additional information:
gcc --version : i686-apple-darwin10-g++-4.2.1
iOS SDK: I have both 4.2 and 4.3
OS X version: 10.6.7
Xcode version (if it matters): 4.0.2
The problem somehow magically doesn't exist, when I tried the same thing on a different Mac with OS X 10.7.1
I have no idea how and why, but now qmake compiles and links.

Resources