dylib

In Xcode, how do I link a dynamic library (libcurl) so that the app also works on older versions of the Mac OS?

女生的网名这么多〃 提交于 2019-12-23 07:14:29
问题 I am using libcurl in a Mac project built and compiled on OS 10.7 Lion. I can link to the dynamic library just fine, using either the -lcurl option in Other Linker Flags or by adding the library to my project. Everything works as its supposed to. I'd like the application to work on OS 10.6 and 10.5 as well. I set the deployment target accordingly. When I go to run the application in one of those versions of the OS, I get a dyld error: Library not loaded: /usr/lib/libcurl.4.dylib Reason:

Expose an interface of a class loaded from a framework at runtime

余生长醉 提交于 2019-12-23 06:13:16
问题 I want to load and manipulate SKUIImageColorAnalyzer and SKUIAnalyzedImageColors objects from the private StoreKitUI.framework . First, I attempt to load the framework at runtime: guard case let libHandle = dlopen("/System/Library/PrivateFrameworks/StoreKitUI.framework/StoreKitUI", RTLD_NOW) where libHandle != nil else { fatalError("StoreKitUI not found") } Then, I verify that the SKUIImageColorAnalyzer class can be found: guard let analyzerClass: AnyClass = NSClassFromString(

Error when making dynamic lib from .o

纵饮孤独 提交于 2019-12-23 04:50:29
问题 I'm trying to make dynamic lib from set of .o files, but when i do gcc -dynamiclib -current_version 1.0 mymod.o -o mylib.dylib or ld *.o -o mylib.dylib i get a lot of errors like: "_objc_msgSend", referenced from: -[NSObject(NSObject_SBJSON) JSONFragment] in NSObject+SBJSON.o "operator new(unsigned long)", referenced from: MStatistic::instance() in MStatistic.o StatisticProfileLoggingObserver::instance() in StatisticObserver.o ld: symbol(s) not found for architecture x86_64 Can you please

Xcode clang link: Build Dynamic Framework (or dylib) not embed dependencies

冷暖自知 提交于 2019-12-23 03:31:34
问题 I’m building a dynamic framework for iOS. It needs reference some symbols from code or other libraries, but I not want link them into the framework. This can be achieved when build an static library, just setup search path and make sure them not included in target’s build phases. But when build a dynamic framework or dylib, this result undefined symbol error. I tried all kinds of link options, eg -l -weak_library -weak_framework -I -rpath -rpath-link . But none works. The link command looks

Xcode 7.3 missing Private Frameworks

妖精的绣舞 提交于 2019-12-22 09:58:21
问题 I recently upgraded my Xcode to version 7.3. When I compile my exisiting project I get this error message: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/PrivateFrameworks' As per this post, private frameworks have been removed with Xcode 7.3. Any suggestions as to potential solutions? 回答1: According to the Xcode 7.3 release notes: The Apple private frameworks have been removed from the iOS

How does Mac OSX determine which dylib to load?

℡╲_俬逩灬. 提交于 2019-12-22 09:13:18
问题 I'm trying to run Apache in Mac OSX Yosemite using MacPorts' PHP (mod_php53.so). Note that I'm not using MacPorts' Apache but Yosemite's Apache with MacPorts' PHP. This was working fine with OSX Mavericks and Mountain Lion in the past. I get this error when running /usr/sbin/apachectl -t in Yosemite: httpd: Syntax error on line 228 of /private/etc/apache2/httpd.conf: Cannot load /opt/local/apache2/modules/mod_php53.so into server: dlopen(/opt/local/apache2/modules/mod_php53.so, 10): Library

“No such function: REGEXP” in sqlite3 on iOS

爷,独闯天下 提交于 2019-12-22 07:50:32
问题 Is it possible to rebuild libsqlite3.dylib with the regexp function added? Or use create_sqlite_function to do it? 回答1: As the SQLite documentation says: If a application-defined SQL function named "regexp" is added at run-time, that function will be called in order to implement the REGEXP operator. so you should be able to use create_sqlite_function like you already suggested yourself. 回答2: create a regex function and then create sqlite function in your run time and pass the address of regex

function that returns value from dlsym()?

泄露秘密 提交于 2019-12-21 22:47:41
问题 Stupid question that I'm sure is some bit of syntax that's not right. How do I get dlsym to work with a function that returns a value? I'm getting the error 'invalid conversion of void* to LSError (*)()' in the following code - trying to get the compile the linux lightscribe sample program hoping that I can link it against the OSX dylib (why the hell won't HP release an actual Cocoa SDK? LS has only been around for what? 6 or 7 years now?): void* LSHandle = dlopen("liblightscribe.1.dylib",

iOS Swift: unsafeMutableAddressor crash on iOS 8

我与影子孤独终老i 提交于 2019-12-21 20:52:34
问题 With the stack trace, unsafeMutableAddressor crash seems to be when it access AppConstant.kShowOverlay from controller's viewDidLoad() I have defined AppConstant.swift like below: struct AppConstant { // MARK: Properties static let kShowOverlay = false } Following is the stack trace from crashlytics: Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000048 0 libswiftCore.dylib 0x51bfc5c _TTWuRq_Ss9Indexable_GVSs5Sliceq__Ss14CollectionTypeSsFS1_10suffixFromuRq_S1_

Calling dlopen on ios

蓝咒 提交于 2019-12-21 17:27:40
问题 This is a much talked about subject, particularly of late. Hopefully this isn't a dupe as I've gone over all the other SO questions. I'm not interested in whether this is legal or not. Whilst it's not 100% clear whether you can freely do what you want with a dylib on iOS8, it appears some amount of dynamic loading is allowed (see for example Can you build dynamic libraries for iOS and load them at runtime?). What I care about is just making dlopen work (forget store submissions for now)! I've