What is a .framework file and how can I get it? - xcode

I'm attempting to use OpenCV in Xcode. I've installed OpenCV 2.4.12 using Homebrew. The associated files are located in /usr/local/Cellar/opencv.
In the documentation I am instructed to add "opencv2.framework" to my project as a binary library. There is no opencv2.framework file anywhere in my opencv directory.
Do I have to make the .framework file or something?

Explore /System/Library/Frameworks for examples on your OS X system. These are bundles containing headers and the compiled framework binaries. If you don't have a .framework directory in the OpenCV resources that you installed, perhaps you installed the source code and you have to build the framework.

Related

How to use Tesseract OCR with Cmake on Windows?

I'm tryint to use tesseract in my cmake project on Windows. I installed tesseract 5.0 and tesseract 4.0. They both come with no cmake folder so the line
find_package(Tesseract REQUIRED)
produces
CMake Error at CMakeLists.txt:14 (find_package):
By not providing "FindTesseract.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Tesseract", but CMake did not find one.
Could not find a package configuration file provided by "Tesseract"
(requested version 4.0) with any of the following names:
TesseractConfig.cmake
tesseract-config.cmake
Add the installation prefix of "Tesseract" to CMAKE_PREFIX_PATH or set
"Tesseract_DIR" to a directory containing one of the above files. If
"Tesseract" provides a separate development package or SDK, be sure it has
been installed.
However, in the installation folder for tesseract 5.0, there's libtesseract-5.dll and many others. Can I link those in my cmake project? If so, how? And why there are no include files in the installation folder? How am I suppose to include the .h files in my project?
UB-Mannheim installer is autotools build and it has only runtime part of tesseract (e.g. executables and linked libraries).
You can not use it for any development because it does not provide needed files (libraries and header files), so missing cmake files are reasonable consequences of this installation.
You can check this information in detail where installer finished.
Have you tried using the MSYS/Mingw build of tesseract: pacman -S mingw-w64-x86_64-tesseract-ocr? Since there is no cmake config file you will have to use pkg_check_modules instead (see also cMakefile for using tesseract and opencv without the opencv bit)

Install Boost.Compute on Mac OS

I'm following this link and trying to install Boost Compute on Mac OS. It says it can be installed with make install but I cannot find a Makefile.
I added the path to the boost-compute folder to the header search path in the Xcode project. But now boost-compute is dependent on boost in my computer, and cannot link to the boost already installed.
Thanks in advance.
No it doesn't, it says it's a header-only library that requires no compilation. It also says that :
Boost.Compute is a header-only library, so no linking is required. To use the library just add the include directory to the compilation flags and link with the system's OpenCL library.

xCode and ImageMagick not working? Linking to project bundle

I made project with ImageMagick included. I installed it through macPorts, linked libraries and headers to my project. Everything worked. But when I try to launch my builded app on other computer, where ImageMagick is not installed, it doesn't even opens my app. Says that Os X version is incompatible. If I install ImageMagick to that computer, then app works OK. What should I do to make it working on computers where users does't have ImageMagick? I guess I have somehow to include headers and libraries to my project bundle. But how to do it in correct way to get working? I tried to copy headers and libraries to my project's bundle but then when I try to build it it says that Magick++.h is not found. Can somebody help me?
I added ImageMagick files from where macports installed it (/opt/local/lib/ and /opt/local/include) to my created folder named ImageMagick, then moved that folder to my project and added ImageMagick/** to Library Search Paths and Header Search Paths. Then removed ImageMagick through macports. Project builds successfully, but doesn't runs. It shows error in console:
dyld: Library not loaded: /opt/local/lib/libMagick++.5.dylib
Referenced from: /Users/development/Library/Developer/Xcode/DerivedData/OGL-cahltqazoqxhrthkxztsqyvvodge/Build/Products/Debug/OGL.app/Contents/MacOS/OGL
Reason: image not found
(lldb)
Libs added to Linked Frameworks and Libraries list is in my app's folder and added to my project. Why it searches for it in /opt/local/lib?

Linking Macports libraries to XCode application

I'm trying to distribute my app's dependencies with the app.
I've got the macports packages librsvg, boost, and cairo installed 64-bit-only on my Snow Leopard system. When I create an .app bundle of my program, it does not work on machines without macports and the relevant libraries installed because they are not included with the app, which searches for the libraries in /opt.
I have tried the --static flag for static linking, but that caused libcrt0 errors.
What's the best method for linking MacPorts libraries and their dependencies to an OSX application suitable for lone distribution?
You'll want to copy the libraries into your application bundle, using a Copy Files Build Phase. dylibs should be put in the Frameworks directory in the app bundle. You'll also have to add the libraries to your Xcode project.
Try using py2app to create a stand-alone app.
I had to just do this for jsoncpp. What I did was I went to linker settings under the project > Build Phases > Link Binary With Libraries then used the add other to go to my library's path and add the library from the folder which would be under opt/local/lib in the default setup for macport
getting the header files was a bit more complicated. In this case I had ended up going to usr/Include finding the file/folder with the headers, copying it into my project and in the cpp file I added the include line with quotation marks ("")
e.g., moved /usr/Include/json directory into the RestTemplate Project folder using copy. then added to main.cpp
#include "json/json.h"

Qt on Mac: where to find "configure"

I am very new to Mac.
I downloaded QT SDK Mac Open source (http://get.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.02.dmg) and installed the Package.
I can run qmake, build samples and run demos,
but I cannot run configure (in order to build the Qt libraries statically).
It says: -bash: No such file or directory.
Documentation says I should run this in the "Qt root folder", but what is this folder in Mac?
I looked for it in /usr/bin, /usr/local/Qt4.6, /Developer/Tools/Qt.
Anyway, what is "configure" on Mac. is it an executable or a script?
Thanks a lot
The SDK download is a pre-built binary library. You need to download the source code version of Qt to be able to configure it to build as static libraries.
The configure script only comes with the source code download version.
I think the SDK only provides the headers and libraries hence the reason you can build applications using Qt. To build Qt itself you will need the source package which is a different download.

Resources