I develop a project on XCode, in which I have added somme dylib. The project compiles, and execute nicely when launched with XCode.
But when I try to launch it in my shell, I got lib errors :
iMac-de-Remi-Doolaeghe:MacOS remidoolaeghe$ ./Adobe\ InDesign\ CS5
2011-12-16 10:08:55.160 Adobe InDesign CS5[8071:903] Error loading /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat: dlopen(/Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat, 265): Library not loaded: libboost_filesystem-xgcc42-mt-1_37.dylib
Referenced from: /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat
Reason: image not found
2011-12-16 10:08:55.161 Adobe InDesign CS5[8071:903] Error loading /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI: dlopen(/Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI, 265): Library not loaded: libboost_filesystem-xgcc42-mt-1_37.dylib
Referenced from: /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI
Reason: image not found
Bus error
That's an error I could workaround by copying the libs in my usr/lib folder. That's ok on my post. But that won't be ok when distributing it. I think I did something wrong with my linker in my XCode project, but can't see what.
I use XCode 3.2.6. The libs are presents in my targets, under "Link Binary With Libraries", and in "Libraries" folder under Groups&Files
I'm not sure if it matters, but my project is a plugin for Adobe InDesign.
Thanks in advance.
I'm speaking under correction, but if it is a dynamic lib, you would have to have that dynamic lib on the machine where it gets distributed to as well. You might be interested in packaging the dynamic lib into your installation wizard or something.
However if it was a static lib, you could have enforced to include all symbols by using one of the following flags:
-Obj-C
-all_load
-force_load
A nice explanation on what these flags do and how to use them can be found here: Objective-C categories in static library
Related
The GLFW library runs fine in an older project (created in XCode 7.x). I used the same method to add library directory and includes files, but this time it prompts a run time error, the error message is:
dyld: Library not loaded: lib/libglfw.3.dylib
Referenced from: /Users/BlacKay/Documents/Projects/OpenGL Tutorials/OpenGL_tutorial_anton/build/Debug/Learn_OpenGL
Reason: image not found
Program ended with exit code: 9
If someone can point what the potential problem is, that'd be great. Thanks~
I make a build for iPhone for the first time and got a problem.
I already checked a lot of posts and didnt find answer.
When i make a build on device a get:
Undefined symbols for architecture armv7:
"RegisterAllStrippedInternalCalls()", referenced from:
RegisterAllInternalCalls() in libiPhone-lib.a(MonoICallRegistration.o)
"RegisterAllClasses()", referenced from:
InitializeEngineNoGraphics() in libiPhone-lib.a(SaveAndLoadHelper.o)
"RegisterMonoModules()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On simulator ok.
libiPhone-lib.a added to link libraries.
Can somebody tell what it is? Please
Your unity version is not compatible, just download the latest version of unity which I believe is 4.3.1 and try recompiling. Here is the link if you need it. http://unity3d.com/unity/download/download-mac
The new version is compatible with armv7.
ok if anyone else is experiencing the same problem here's a way out:
those 3 methods mentioned are declared in the RegisterMonoModules.cpp in the Libraries folder, usually. so take that cpp file and add it to your target's Build Phases > Compile Sources
then if you have additional SDK's integrated that are not added to the 'Compile Sources' the new build will throw some other errors. just make sure to add the wrapper .mm files from the sdk's to your Compile Sources. Usually one .mm file per sdk. (e.g. for unity facebook sdk it's FbUnityInterface.mm file)
hope this helps
I am too much of this Static Libary thing in Xcode 4.X
Following are the steps that I usually do..
1)For making a static libary , I open Xcode , new , static libary , and then by adding some classes in the project .. then build phases ->copy headers -> add all headers here one by one,and then i build up the project
when run on ios simulator -> static libary does not created ..(red color)
when run on ios device - > static library gets created..
2) for using the library..
I make a new Project , then i "add files to project" and also "copy if needed" the following 2 files..
.a file (i.e.static library)
folder consisting the headers of library files
Now when I try to import a header file in my project , there is no "suggestion" appear ...but still i write and it does not give an error "header file not found"...
but when I run the project it gives the error like:
ld: warning: ignoring file
/Users/Subodh/Library/Developer/Xcode/DerivedData/LibraryImporting_test-cbchzzjdcehzvfgwmzbvifrnrwgk/Build/Products/Debug-iphoneos/libLibraryImporting_test.a,
file was built for archive which is not the architecture being linked
(i386):
/Users/Subodh/Library/Developer/Xcode/DerivedData/LibraryImporting_test-cbchzzjdcehzvfgwmzbvifrnrwgk/Build/Products/Debug-iphoneos/libLibraryImporting_test.a
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_LibraryImporting_test", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Plz guide me....point out if get wrong at some step....help plz
it will be better if someone mentions all the steps as i have done in making a library and using it in a project...it will be a great help
The key to the issue is this part of the error message:
file was built for archive which is not the architecture being linked
(i386)
You have imported the library built for the iPhone Device (ARM) by the look of it, and you are trying to use it in the iPhone Simulator which is i386.
What I would recommend is using an Xcode Workspace where the static library project is one of the projects and the iPhone app is another project. This way Xcode will build the library, as required, for Debug/Release and Device/Simulator.
I'm trying to link the Box2D C++ library to my Xcode 4.4 project through the libBox.2.1.0.dylib file. Here's what i did:
Went to the "Targets", selected my application, and added my .dylib file in the "Link Binary With Libraries" section
Created a new "Copy Files" build phase and set it to "Executables" (so the .dylib file is right next to the internal executable in the .app bundle)
Successfully compiled my project with no errors whatsoever
Ran project and got the following runtime-error:
dyld: Library not loaded: libBox2D.2.1.0.dylib
Referenced from: /Users/****/Documents/Xcode Projects/ProjectName/DerivedData/ProjectName/Build/Products/Debug/ProjectName.app/Contents/MacOS/ProjectName
Reason: image not found
I followed all the steps from this link here, but I still get the runtime-error for some reason. I am I missing something important in my setup?
I compiled the QJSon code from the command line and it generated a dylib (libqjson.0.7.1.dylib) I then added this file as an external dependency to one of the libraries in my app. (using Xcode 4.3 as the IDE) everything seems to compile correctly. When i go to run the app i get the following error:
dyld: Library not loaded: /Users/shawneckley/Mac_Dev/Development/build/thirdparty/qjson/src/lib/libqjson.0.dylib
Referenced from: /Users/shawneckley/Mac_Dev/Development/Build/bin/Debug/libstonewedgeaccountandclient.dylib
Reason: image not found
(lldb)
any idea why this could be happening?