dylib

How to determine if an OS X dylib was linked with -flat_namespace

馋奶兔 提交于 2019-12-18 17:57:28
问题 I have a third party OS X dylib that I'm using in my app and don't have easy access to its creator. I'd like to determine if it was linked with -flat_namespace. Is that possible? If so, how? 回答1: Run otool -hV on the library. If you don't see TWOLEVEL , then it was linked with -flat-namespace . For example: twolevel.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 8 672 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS versus

How to determine if an OS X dylib was linked with -flat_namespace

风格不统一 提交于 2019-12-18 17:57:02
问题 I have a third party OS X dylib that I'm using in my app and don't have easy access to its creator. I'd like to determine if it was linked with -flat_namespace. Is that possible? If so, how? 回答1: Run otool -hV on the library. If you don't see TWOLEVEL , then it was linked with -flat-namespace . For example: twolevel.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 8 672 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS versus

Compile a binary file for linking OSX

空扰寡人 提交于 2019-12-18 12:37:23
问题 I'm trying to compile a binary file into a MACH_O object file so that it can be linked it into a dylib. The dylib is written in c/c++. On linux the following command is used: ld -r -b binary -o foo.o foo.bin I have tried various option on OSX but to no avail: ld -r foo.bin -o foo.o gives: ld: warning: -arch not specified ld: warning: ignoring file foo.bin, file was built for unsupported file format which is not the architecture being linked (x86_64) An empty .o file is created ld -arch x86_64

How to insert a LC_LOAD_DYLIB command into a Mach-O binary (OSX)

删除回忆录丶 提交于 2019-12-18 11:56:31
问题 I'm looking to patch a piece of abandonware with some code. The software is carbon based, so I can not use an InputManager (at least, I do not think I can). My idea was to add a dylib reference to the mach-o header, and launch a new thread when the initialization routine is called. I have mucked around with the mach-o header using a hexeditor to add the appropriate load command (LC_ LOAD_DYLIB). otool reports what I expect to see, so I'm fairly confident that the file is correctly formatted.

iOS 6.1 Dynamic Library build and link

拜拜、爱过 提交于 2019-12-18 05:13:10
问题 I am trying to create a dynamic library for iOS and load it at runtime. After taking a look at this question and this answer, I have been doing it using iOSOpenDev and deploying everything on my iPhone. The xCode project for the dylib is called KDylibTwo and the files I modiefied are: KDylibTwo.h #import <Foundation/Foundation.h> @interface KDylibTwo : NSObject -(void)run; @end KDylibTwo.m #import "KDylibTwo.h" @implementation KDylibTwo -(id)init { if ((self = [super init])) { } return self;

dyld: Library not loaded. Reason : no suitable image found

最后都变了- 提交于 2019-12-17 18:52:53
问题 I've looked at a bunch of answers here and none have fixed my issue. I have an Xcode workspace with a custom framework and an iOS app project. The project has been working fine until this morning, now it builds but immediately crashes: dyld: Library not loaded: @rpath/ONCKit.framework/ONCKit Referenced from: /private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/atero_t Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle

Brew doctor: dyld: Library not loaded & Error: No available formula for zlib

一曲冷凌霜 提交于 2019-12-17 15:46:46
问题 When I brew doctor I get the following errors: dyld: Library not loaded: /usr/lib/libltdl.7.dylib Referenced from: /usr/local/bin/php Reason: image not found Error: No available formula for zlib The file libltdl.7.dylib is not in my /usr/lib directory, but there are several other .dylib files. I'm running 10.8.1 with the latest version of Xcode (4.4.1) and its Command Line Tools installed. Any idea how to solve these errors? 回答1: Try to re-install libtool by: brew reinstall libtool -

Why Xcode 7 shows *.tbd instead of *.dylib?

倾然丶 夕夏残阳落幕 提交于 2019-12-17 07:01:11
问题 Xcode 7 In Target > BuildPhases > Link Binary With Libraries > tap + button When choosing frameworks to add, you cannot find *.dylib, you'll see *.tbd instead. What is the reason for this? **For people who need dylib, follow from this post Choose "Add other" Once in the file selection window do "CMD"+Shift+G (Go to folder) & type /usr/lib/ From /user/lib you can find the *.dylib files 回答1: I've scoured Google but the only thing I can find so far is the following quote from the Apple developer

Where does @executable_path point to in a Java program

女生的网名这么多〃 提交于 2019-12-13 18:07:06
问题 I'm trying to load a native library in Java on Mac OS X 10.10.5 like this: System.loadLibrary("SgCore_wrap"); and it throws an exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/nyholku/sgCoreTest/libSgCore_wrap.dylib: dlopen(/Users/nyholku/sgCoreTest/libSgCore_wrap.dylib, 1): Library not loaded: @executable_path/../Frameworks/libsgCore64.dylib So my question is where does @executable_path points to in case of a Java program and does this depend on weather I run from

SFML 2.1 & “lazy symbol binding failed”

人走茶凉 提交于 2019-12-13 04:30:26
问题 I've compiled my SFML program with g++ and that seems to be working fine now (had issues with it previously), however when I try to run the resulting output, I get the following error message: dyld: lazy symbol binding failed: Symbol not found: __ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE Referenced from: /Users/fabricecastel/Work/Game_Projects/SFML_tutorials/./a.out Expected in: /usr/local/lib/libsfml-graphics.2.dylib dyld: Symbol not found: _