I wanted to try some things with openFrameworks but got stuck trying to use libusb, which is not available as of addon.
I copied it in the "other" folder but don't no how to include it in the project.
The included ofxKinect addon includes compiled libusb and headers. If you add that add-on via the project generator, you'll have access to libusb.
Related
I want to compile the IOSerialFamily kext bundle on my own machine (OSX 10.14.4) using Xcode 10.2. I downloaded the source tarball from Apple's open source repository, but even though the project contains a .xcodeproj file, it's obviously not set up to compile on a personal machine. The project does not use the public SDK, but instead uses a macosx.internal SDK which I assume to be available only to Apple employees.
I switched it to use the installed SDK, but many problems followed. For example, the "internal" SDK's sys/tty.h file must contain a full definition of struct tty, whereas the public SDK only contains a forward declaration of the struct. I suspect I can patch in the version from the darwin-xnu kernel, but that would only fix one of the many errors. I'm looking for a solution that would help me fix them all simultaneously.
Does anyone have any experience compiling these "Open Source" projects? How can I set up my environment to do this? Do I have to go through and painstakingly hack away at each individual compiler error? Is there somewhere else that I can obtain a working copy of the IOSerialFamily kext source that will compile on a machine with the public SDK?
I'm developing a plugin for mac. I'm trying to use afnetworking and other frameworks which needs arc. I'm trying to create a .a(library) for the framework and access it in firebreath. I tried adding the directory which contains .a using include_directories in projectdef.cmake then linking it in target_link_libraries. Please lemme know how to add this and whether the framework can be used in firebreath without any pitfalls
I have used external libraries in firebreath. Though I have used editors to link the libraries. You need to specify .h files for the function prototypes, along with .a files which will dynamically link to .dylib
Try adding these via Xcode and see if that works.
I'm writing an application in which I want to use free image to load files. I am on MacOSX 10.8.2 and I am using the mac ports version of free image. I had it working, but when I tried putting it on another computer without the port, it wouldn't run because it didn't have the files. The macports version comes with a dylib, can I use that to run it without downloading the port? If I can how would I compile it with the project because I have tried linking it as a Binary Library, but I can't include the files. Any help would be appreciated, as I have bee at this for a few hours now.
Thanks
You can actually build the FreeImage library as a static library. Unfortunately, the downloadable source from the http://freeimage.sourceforge.net/download.html website uses makefiles that are expecting to use the older SDKs for Xcode3.
I actually updated the Makefile.osx to build with Xcode4 using the 10.7 SDK and posted the change to https://gist.github.com/AhiyaHiya/5105571
You should be able to run this make from Terminal.app and create your .dylib and .a files for your needs.
I’m writing Qt application using some 3rd party library. I want to package it into a bundle.
I’m using macdeployqt and this tool isn’t just copying Qt Frameworks, but also 3rd party library into Contents/Frameworks inside the app bundle.
The problem is that this 3rd party library need some additional file to work properly. Originally library is installed in /usr/local/lib and some necessary stuff is located at /usr/local/share.
How to package this stuff into app bundle?
I think it depends on how the specific library is coded. If the paths are hard coded as full paths or relative to some system path, then there's really nothing you can do. One possible solution is to include the files as resources and install them during the startup of your app when you detect that they are missing in the user's system.
I've built a command-line utility (Foundation tool) in Xcode, using Cocoa. The tool makes use of a 3rd party framework.
Everything works OK in Xcode, but how do I deploy this program?
If I run the app from Finder, it can't find the library because it's looking in ../Frameworks/etc. Can I statically link in the 3rd party framework?
Unfortunately, there is no way to bundle a framework with a command-line Utility in OS X and I suspect that the framework you're linking to is expecting to be bundled in the app bundle's Frameworks/ directory. If you have access to the framework source code, you can compile a static library and statically link it to your application (or include the source in your application target directly). If you don't have the source code or you don't want to statically link the library for some reason, there are two remaining options:
If you have access to the system-wide /Library/Frameworks folder, you can install the 3rd party framework there. This require that the framework's Installation Path (the INSTALL_PATH build setting) be set to /Library/Frameworks at build time or that you use the install_name_tool to change the frameworks install path to /Library/Frameworks (if you don't have the framework's source code).
Build an application bundle (as if you were building a GUI app) with your command-line utility as the app bundle's executable (i.e. in AppBundle.app/Contents/MacOS/). You can then copy the 3rd party framework to the app bundle's frameworks directory. You can then put the app bundle anywhere you want and create a symbolic link to the command line utility.
Option 1 is definitely the more accepted approach, but I've used option 2 when there was a valid reason.
You can find more information on building, linking, and installing frameworks in Apple's Frameworks Programming Guide.
Another way, if you have the source code for the framework, is to add a static library target and build a static lib from it. Then you can statically link it into your command-line tool.
As of Xcode 9.3.1, I was able to have the framework added to the command line tool by setting the Mach-O Type to Static Library for the framework. Then in the command line target make sure to add the framework to the Target Dependencies & the Link Binary With Libraries Build Phases. The built executable was then able to run with no issues.
You can use marathon to manage dependencies
https://github.com/JohnSundell/Marathon
This would need more thought if you wanted to distribute app. (You would probably want to install into frameworks folder in that use case.) your mileage may vary with this solution.