I have been trying to compile rabbitmq-c as per hte instructions from R_R (Not able to build rabbitmq-c for iOS application) but I get the following error:
CMake Error at /Users/karela/appDir/ios-cmake/toolchain/iOS.cmake:101 (message): No iOS SDK's found in default seach path /Developer/Platforms/iPhoneOS.platform/Developer. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.
I have searched all I could but cannot figure out what's wrong. Probably something with ios-cmake toolchain but not sure why and how to fix it.
Thanks,
I'm using ios-cmake too, even if I didn't success yet, I can give you the solution of your problem.
When you use cmake, you should add this :
-DCMAKE_IOS_SDK_ROOT=/path/to/Platform/Developer/SDK
For exemple, this is my path :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk
Related
I'm trying to get ImageMagick to work in my iOS project. Unfortunately everything I have tried so far has not worked.
Cocoapods
The most obvious approach would be to use the cocoapod. Unfortunately after installing the cocoapod there doesn't appear to be anything exposed to swift to import. Maybe I'm missing something obvious and if anyone has any ideas that would be great. Unfortunately the documentation is lacking as far as specific examples go.
Static library - approach #1
The official ImageMagick docs provide some instructions to compile the latest version of ImageMagick and include a static library in your Xcode project. Unfortunately the first step of the instructions requires running a bash script imagemagick_compile.sh which I cannot find. Once again I could be missing something obvious.
Static library - approach #2
After some additional searching I found the ~Claudio guy which the ImageMagick docs mention as the maintainer of the iOS version of ImageMagick. He has a repo with similar instructions as provided by ImageMagick but this repo includes a bash script to compile and generate a static library of ImageMagick. I tried running the script directly ./all.sh 6.8.8-9 but soon realized I hadn't setup a build directory they way his instructions outlined and I got stuck getting libpng installed correctly.
Static library - approach #3
The same repo with the instructions to compile and generate a static library also includes an old sample iOS project with a static library already included for an older version of ImageMagick. This just about worked except the ImageMagick library has a class Timer that clashes with the Timer class provided by Swift4/iOS so I couldn't get my project to compile using this static library of ImageMagick.
ImageMagick iOS Questions on SO
There are a handful of other questions on Stack Overflow that deal with running ImageMagick on iOS so I know other people have done it but nothing very recent. If anyone has any ideas that would be greatly appreciated, thanks!
Un-answered question on how to use ImageMagick on iOS: ImageMagick iOS image Potentially useful comment that includes some of the same links that I provided above.
Someone already using ImageMagick for iOS but gives no details on how it was implemented: ImageMagick circular dstortion on iOS
Un-answered question from someone already using ImageMagick in their app: Ios - ImageMagick - No Image Created after Distortion
More recent question related to warnings using the cocoapod version: iOS: ImageMagick compiler warnings in Xcode
Other questions: https://stackoverflow.com/search?q=imagemagick+ios Unfortunately I haven't found any of these that have helped.
To integrate ImageMagick into iOS you will need to do the following:
Install the library available here https://www.imagemagick.org/download/iOS/
You will need a Swift-Objective-C bridging header that includes:
#import "ImageMagick.h"
#import "MagickWand.h"
You will need to modify any functions that reference Timer to Foundation.Timer, this will resolve any conflicts with the ImageMagick library
You will need to add under Your target > Build Phases > Link Binary With Libraries > "libxml2.tbd".
Hope this helps
I have Boost built as a framework for iOS. This is currently installed in Applications/Xcode.app/Contents/Developer/Library/Frameworks/.
When I create a "hand-generated" XCode project, I have no problems using this framework.
I'm now trying to use CMake to generate an XCode project. I found this helpful, cross-compiling toolchain (https://github.com/cristeab/ios-cmake). This works as long as I do not include
find_package( Boost )
But when the above line is added to my CMakeLists.txt file, I get a "Boost_INCLUDE_DIR-NOTFOUND"
So question is: has anyone had success in using CMake with Boost for iOS? If so, any help on how to go about it is greatly appreciated.
I found another SO user trying to do something similar here: How to find a iOS/mac OS X framework via Cmake
But it does not offer much details other than using "CMAKE_FRAMEWORK_PATH".
So any help is much appreciated.
Thanks...
find_package cannot find boost built for ios (tested on cmake 3.13 and 3.14)
Was able to solve it in following way.
Build boost using https://github.com/faithfracture/Apple-Boost-BuildScript
set BOOST_ROOT to Apple-Boost-BuildScript/src/boost_x_xx_x
for iOS:
set(Boost_INCLUDE_DIRS "${BOOST_ROOT}")
set(Boost_LIBRARIES "${BOOST_ROOT}/iphone-build/stage/lib/libboost_date_time.a")
set(Boost_LIBRARIES "${Boost_LIBRARIES};${BOOST_ROOT}/iphone-build/stage/lib/libboost_regex.a")
set(Boost_LIBRARIES "${Boost_LIBRARIES};${BOOST_ROOT}/iphone-build/stage/lib/libboost_system.a")
iOS simulator:
set(Boost_INCLUDE_DIRS "${BOOST_ROOT}")
set(Boost_LIBRARIES "${BOOST_ROOT}/iphonesim-build/stage/lib/libboost_date_time.a")
set(Boost_LIBRARIES "${Boost_LIBRARIES};${BOOST_ROOT}/iphonesim-build/stage/lib/libboost_regex.a")
set(Boost_LIBRARIES "${Boost_LIBRARIES};${BOOST_ROOT}/iphonesim-build/stage/lib/libboost_system.a")
I hope it's not too late:)
I came across almost same issue, find_package always complain that can not find the lib, even the search path is correct, notice that the similar issue also exist for Android NDK
For the ios I suggest:
Enable boost debug by set(Boost_DEBUG ON), then check the path specified is correct or not, ref to this link for more info
How can I get CMake to find my alternative Boost installation?
Try find_host_package instead of find_package, I found some clue in ios.cmake which may lead to the issue:
# only search the iOS sdks, not the remainder of the host filesystem
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
As is know to us all, objc's runtime is open source and can be downloaded from: http://www.opensource.apple.com/tarballs/objc4/
After I download the tarball an extract it. I open objc.xcodeproj using xcode. However, when I build it, there are many erros, such as, can not find some headers. I googled all the missing headers, download them, put them in /tmp/objc.dst/usr/include. But without luck, still errors.
I searched the internet, but I can find few documents or instructions about:
how to compile apple's objc runtime from source code?
After compile it , I should get libobjc.A.dylib, how to use it (as a replace of the system's libobjc.A.dylib) ?
I really appreciate any help you can provide.
Compile with no error under 10.10.2(14C1514), Xcode 6.2 (6C131e).
You need OSX 10.8 SDK, which you can get from early Xcode install dmg or this repository https://github.com/phracker/MacOSX-SDKs (If you download sdk from this repo, you may need to fix the soft links using this script http://blog.jeswang.org/blog/2014/10/26/fix-slash-soft-slash-links-slash-in-slash-an-slash-archived-slash-file/, you may need to run the script two times for the recursion of references)
More the 10.8 sdk to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
Clone this repository https://github.com/Jeswang/objc4-532.2
Compile and Run the debug-objc scheme
You can set any breakpoint in the source and debug the whole runtime.
I am having no luck the last few days since Xcode 5.1 came out.
I keep getting this error on an old project that supports iOS 6.0:
ERROR:
clang: error: unknown argument: '-fno-obj-arc' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
There are not many posts about this on the internet and some suggestions seem to be to change your CFLAGS but I have no idea how to do that in Xcode.
Apple suggests this from their documents:
Compiler
As of Apple LLVM compiler version 5.1 (clang-502) and later, the
optimization level -O4 no longer implies link time optimization (LTO).
In order to build with LTO explicitly use the -flto option in addition
to the optimization level flag. (15633276) The Apple LLVM compiler in
Xcode 5.1 treats unrecognized command-line options as errors. This
issue has been seen when building both Python native extensions and
Ruby Gems, where some invalid compiler options are currently
specified. Projects using invalid compiler options will need to be
changed to remove those options. To help ease that transition, the
compiler will temporarily accept an option to downgrade the error to a
warning:
-Wno-error=unused-command-line-argument-hard-error-in-future
Note: This option will not be supported in the future. To workaround
this issue, set the ARCHFLAGS environment variable to downgrade the
error to a warning. For example, you can install a Python native
extension with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName
Similarly, you can install a Ruby Gem with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName 16214764 updated
How do I get this workaround? Obviously Apple has messed up because it should only be presenting me with a warning and not an error according to their documents.
Any help would be greatly appreciated. I can not build my app until this issue is rectified.
There is no such thing as -fno-obj-arc. This never was working correctly; you just weren't seeing the warnings. The correct form is -fno-objc-arc.
EDIT (appended info drawn from my comments below): This is not a clang error. It is an error in the project; clang is merely reporting it. The project itself wrongly contains the -fno-obj-arc argument, probably in the Compile Sources build phase of the target (as described here: How can I disable ARC for a single file in a project?). It is easy to type the setting incorrectly; what has changed in Xcode 5.1 is merely that clang is now calling the problem to your attention. Thus, as I said before, this never was working correctly; you presumably intended to turn off ARC for certain files, but you were failing to do so, as the build argument was incorrectly entered.
Update to xcode now throws unknown compiler flags as hard errors rather than warnings. Found this to be helpful:
https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/
I figured out with a small bit of help from matt.
I was trying to figure out where to change the -fno-obj-arc and NO ONE answered that question.
I found this link to be helpful...
http://blog.evanmulawski.com/?p=36
Once you select build phases and compile sources, you can look next to the files in your project and change their build flags.
Thanks for the attempt guys.
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
You need to change -fno-obj-arc to -fno-objc-arc.
Select project -> targets -> build phases ..see picture
Since last month I was working with OpenCV2.2(pre-built) using c functions only in code::blocks. But I need to shift to c++ API. But when I run the c++ code I am getting error like "undefined reference to c++ function". I just search in internet and found that I need to build from source. So I just moved to OpenCV2.4.3. These are my setting what I do with OpenCV2.4.3 for configuring project in code::blocks.
Extract OpenCV2.4.3 to E:\opencv
Add the line "E:\opencv\build\x86\mingw\bin" to path.
And in code::blocks set up the project like
-> Compiler and debugger setting->search directories add "E:\opencv\build\include"
-> In linker tab add "E:\opencv\build\x86\mingw\bin"
-> In limker setting tab add "E:\opencv\build\x86\mingw\lib"
And I build my project successfully but while I am running my project I am getting the error like "Program Can't start because libgcc_s_dw2-1.dll missing from your computer".
I am using code::blocks with MingGW compiler.
My questions are
1. Why I can't run c++ code using OpenCV2.2 while c code is successfully build and ran. Is it the pre-built library problem. If so where can I download OpenCV pre-built library which support both c and c++ code.
2. Why the MingGW compiler showing the error like "libgcc_s_dw2-1.dll missing "for OpenCV2.4.3 where as OpenCV2.2 successfully build and ran using the same MingGW compiler.
Any help will appreciated.
Thanks in advance..........
I had the same problem when I switched from OpenCV 2.0 to OpenCV 2.4.3. So I will suggest the following.
Uninstall both CodeBlocks and Opencv 2.4.3
Reinstall both and integrate them using the same steps you followed earlier.
Let us know if this works.