I have built chromium from https://chromium.googlesource.com/chromium/src/+/lkcr/docs/mac_build_instructions.md
I am able to successfully build and run on the machine that i built the code but not able to run it on any other mac.
I want to be able to distribute the application file.
The application crashes because its not able to find some system libraries which load dynamically.(libsystem_kernel.dylib , libsystem_pthread.dylib, libsystem_c.dylib ,libdyld.dylib ).
These dylibs can be found in /usr/lib folder on Mac OSX
Any suggestion on distribution of the app?
Related
I'm trying to build a Qt-based application on Mac OSX, and something in my application bundle is pulling in a Qt library from /Library rather than from the application bundle.
I've done this successfully in the past, so I know about using install_name_tool to link applications and libraries to the bundle versions of libraries. I've done this, but I must be missing something. I've tried setting DYLD_PRINT_LIBRARIES, but I'm not really sure how this helps: I can see which Qt library is being pulled in from /Library first (QtXml), but I don't know which file in the bundle is pulling in this library.
Is there some trick to tracing back which file is loading a particular library?
Use otool utility to see what libraries are used by your app and where the app expects to find them:
otool -L yourApp.app/Contents/MacOS/yourApp
I've compile my helloworld gtk+ application using MinGW for Native MS Windows. The instructions I followed were here.
If I run the helloworld.exe application from the same command window that I built the application, it works fine.
However, I would like to distribute the gtk+ libraries with my app, so I have downloaded and extracted all of the runtimes from http://www.gtk.org/download/win32.php.
I have also copied my helloworld.exe application to the bin folder with the gtk runtime files.
When I attempt to run my application in a new command prompt, I get the following error:
My machine is 64 bit, but I downloaded the 32 bit runtime for gtk.
Any pointers will be appreciated.
One option is to extract the gtk+ all-in-one-bundle to a clean folder, and copy the application to the extracted bin folder.
The extracted all-in-one-bundle can then be zipped with the included application and distributed as a zip or tar file.
I want to distribute a wxHaskell application on Mac OS X. How do I go about creating a Mac OS X app which can be used standalone without the user having to install any extra libraries?
I noticed the cabal-macosx project which makes .app bundles for Mac OS X. When I built the example wxHello application, the app bundle worked fine on my machine (after adding extra-lib-dirs: /usr/lib to the .cabal file). But when I tried it on another machine, I got the error: Dyld Error Message: Library not loaded: /Users/binil/.cabal/lib/wxc-0.90.0.3/ghc-7.0.4/libwxc.dylib.
You can place the required dylibs in the Contents/Resources folder within your app bundle, as that is part of the search path for dylibs. You can automate this using the project's copy files build phase.
Technically (though this does not always work for all dylibs), you should be able to pull it off "correctly" by converting the dylib to a Framework, then linking against it in your XCode project. There is a conversion script available [note: download].
I have a problem deploying Qt frameworks with my Mac app, and I hope some will have a clue why I get this error, when I run the app on clean Mac, i.e. not a developer Mac.
OS: 10.7 .2 and using XCode
Error msg:
Library not loaded: #loader_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
Referenced from:/Users/someUser/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle/Contents/MacOS/../Frameworks/../Frameworks/QtXml.framework/Versions/4/QtXml
Clearly something is wrong since the QtXml is referenced from /../Frameworks/../Frameworks, which doesn’t exists.
This is the set up: I have a dylib that uses QtCore and QtXml (not by my choosing, but for now I need those two frameworks), the dylib is used in a NSBundle, which is loaded by the main app, the bundle is located in the resource folder. The dylib is moved by Copy Files Build Phase to the folder Contents/Frameworks and with otool the install_name is set to (as stated by http://doc.qt.digia.com/4.3/deployment-mac.html):
#loader_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
#loader_path/../Frameworks/QtXml.framework/Versions/4/QtXml
then the Qt frameworks are moved to Contents/Frameworks and the install_name of the is set to:
#executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
and for the QtXml
#executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml
with reference to QtCore:
#executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
Now when I run the app on the developer mac it clearly works since Qt is installed, but when moved to a clean mac I get the error msg, readable in the Console app.
I’ve tried to change the executable_path to loader_path, but this didn’t work.
I have no idea what I’m doing wrong or why it won't for, and have not been able to find anything on Google, of course I could be looking at the wrong places. Any ideas how to fix this problem?
This is the entire error message:
MainApp: Error Domain=NSCocoaErrorDomain Code=3587 "The bundle
“Library” couldn’t be loaded because it is damaged or missing
necessary resources."
(dlopen_preflight(/Users/someUser/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle/
Contents/MacOS/Library): Library not loaded:
#loader_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
Referenced from: /Users/ someUser /Downloads/
MainApp.app/Contents/Resources/Lib/Library.bundle/Contents/MacOS/../Frameworks/../Frameworks/QtXml.framework/Versions/4/QtXml
Reason: image not found) UserInfo=0x107c5d5d0
{NSLocalizedFailureReason=The bundle is damaged or missing necessary
resources., NSLocalizedRecoverySuggestion=Try reinstalling the
bundle.,
NSFilePath=/Users/someUser/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle/Contents/MacOS/Library,
NSDebugDescription=dlopen_preflight(/Users/someUser
/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle/Contents/MacOS/Library):
Library not loaded:
#loader_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
Referenced from:
/Users/someUser/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle/Contents/MacOS/../Frameworks/../Frameworks/QtXml.framework/Versions/4/QtXml
Reason: image not found,
NSBundlePath=/Users/someUser/Downloads/MainApp.app/Contents/Resources/Lib/Library.bundle,
NSLocalizedDescription=The bundle “Library” couldn’t be loaded because
it is damaged or missing necessary resources.}
On the development mac everything works because the Qt libraries are installed. On any mac you ship the app to, though, this likely won't be the case. The Qt suite comes with a tool called macdeployqt to fix this. So in a terminal, after you've compiled your application, do something like:
# cd my-cool-app-Desktop
# macdeployqt my-cool-app.app
Note that it can also be used to create a .dmg file for shipping everything together:
# cd my-cool-app-Desktop
# macdeployqt my-cool-app.app -dmg
Once you've done that, the .app directory or .dmg file can be given to someone else without Qt installed to use and run as they normally would.
The one caveat is that the next time you try to run it on your developer machine, it may complain about multiple shared libraries installed. So once you've copied it else where in order to distribute it, remove the entire .app directory and let qtcreator (or whatever) rebuild it.
UPDATE
As stated compiling QT to static libs is the way to go. With the release of Mavericks (10.9) we need to codesign frameworks as well (http://furbo.org/2013/10/17/code-signing-and-mavericks/), and with QT4.8.5 there are some issues (https://bugreports.qt-project.org/browse/QTBUG-32896). Even with suggested fixes I still had some issues when running the app on a clean machine. Therefore, I ended up with compiling Qt5.2 to staticlibs, link them in the app, and codesign them.
OLD
Problem sovled, I moved the Qt-frameworks into the app bundle in Contents/Frameworks and with otool set the path to #executable_path/../Frameworks, i.e. moved it out of my library bundle. Yes the solution is simple, but I'm still not sure why the library executable couldn't find the frameworks when using #loader_path.
The best solution would probably be to use a static library and not wrap it in a bundle...you learn everyday ;)
I have already developed a setup.exe for windows, having features like autodetecting JRE version, autoinstalling required JRE version, autostart on windows start etc. I have made this exe from a jar file(jar file was not having the above mentioned features. Features are added later when transforming a JAR to EXE. Now I was wondering if I can somehow convert exe to DMG, APP or JAR or I can add the above mentioned features in my JAR file only.) By default Mac comes with Java version 5 and my application needs minimum Java version 6 to run
The normal way to distribute a Java application on a Mac is different than on Windows. You don't need a native binary to run a Java application on Mac because you can bundle it into an application (.app) file.
JarBundler, which is part of the Xcode Deveoper Tools, helps you insert your JAR file into a new .app file. You'll also specify your icon at this stage and the main class.
The app file is really just a folder. You can open the .app file as a folder by option-clicking on the application file and choosing "Show Package Contents" in the pop-up menu. Sometimes you may need to tweak the Info.plist file in the application, as there are a lot of options. There is complete documentation about the Info.plist file on the apple's developer website.
Once you have your application, you can bundle that up into a Package using PackageMaker, also part of the Xcode Developer Tools.
Further, you can bundle the package into a disk image (DMG) using DiskUtility, which you'll find in the Utilities folder.
Regarding Java versions, prior to Snow Leopard, Java 6 was only available for Intel Macs. If you require Java 6, you'll need to require that they have an Intel Mac with the latest updates or have Snow Leopard. Alternatively, you could package SoyLatte into your app to replace the native Java runtime. You'd basically be distributing a 32-bit version of Java 6 with your app.
Java 1.6 is not released for all macs. Mine for one does not have it there is nothing you do about it.
As for creating a dmg. In the mac os x install cd is a package called developer tools. Which includes an application called Jar Bundler that allows you to wrap jar's in to apple's .app files(exe's for mac). As for a dmg image you can create it from command line or from ant target.