dylib

linking and using a C++ library with an Objective-C application

余生颓废 提交于 2019-12-04 19:13:57
问题 I'm writing a graphical application using Objective-C for the front end and C++ for the graphics processing and network communication. I read around on Apple's site looking for a way to link either a .dylib or .so with my C++ code in it to my Xcode project, but nothing seemed to work. I was able to get the project to reference it and link against it, but when I tried to call functions from that .dylib, it was saying that it didn't know what I was trying to do. Does anyone know what is going

function that returns value from dlsym()?

烂漫一生 提交于 2019-12-04 18:15:59
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", RTLD_LOCAL|RTLD_LAZY); if (LSHandle) { LSError (*LS_DiscPrinter_ReleaseExclusiveUse)() = dlsym(LSHandle,

QtCreator for iOS: How to deploy a dylib shared library with my application

人盡茶涼 提交于 2019-12-04 17:22:10
I'm having a hard time deploying dynamic shared libraries on iOS. To isolate and expose the problem, I have a very simple "HelloWorld" project: A library exporting class with a function returning "Hello World" and a program using the class and displaying the message. I'm using QtCreator with Qt 5.5. I'm able to generate the .dylib file and link my program. But, when I deploy it on the iPhone, I get the error: Démarrage des processus distants. dyld: Library not loaded: libMyLib.1.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/D6942CCE-828D-4C10-86DA-F7DA7ADF7449/MyApp

Building and Using a DYLIB in Xcode

混江龙づ霸主 提交于 2019-12-04 14:50:42
I'm trying to build a .dylib in Xcode. Currently the .dylib builds, but when I drag the .dylib into another project and try to #import one of the headers (Seeker.h) in the .dylib, I get this error: *: No such file or directory Seeker.h: No such file or directory The project is available as an Xcode project here . I can confirm the header is indeed in a path alongside the .dylib once built, but as for what to do with it I have no idea. My only experience with .dylib files is frameworks built into Mac OS X, like libsqlite3.dylib, which works perfectly. All the tutorials I can find on .dylib

Dyld: Library not loaded

江枫思渺然 提交于 2019-12-04 14:36:12
I am trying to link the library libssh2.1.dylib to my iPhone Xcode project but I get this error when I try to link it. If I don't add this as a framework I get Symbols not found error. Now /Users/Matt/Documents/Development/iPhoneApps/Portscanner/lib/libssh2.1.dylib is not the correct pathway to that file. I downloaded the library off the internet and its the pathway of the Author's computer. I have the file located in a totally different place. How do I change the pathway reference? Heres the error I get: dyld: Library not loaded: /Users/Matt/Documents/Development/iPhoneApps/PortScanner/lib

How to use a C dylib from a Swift file in a framework

徘徊边缘 提交于 2019-12-04 12:19:59
问题 I'm looking at starting to use Swift in a framework, which uses libz.dylib , but it looks like there's no way to import it from within Swift. I tried import zlib and import libz , which didn't work. ZLib is already linked to the target. It seems like the only way to get my Swift code to see the zlib classes is to import the necessary headers in a bridging header, but framework targets can't have a bridging header, so is there a way to use a dylib? 回答1: I have added a C/C++ dylib library, with

How to build apple's opensource libc?

 ̄綄美尐妖づ 提交于 2019-12-04 11:38:01
问题 I'm trying to build apple's opensource libc (from http://www.opensource.apple.com/source/Libc/Libc-763.11/) on my OS X 10.6.8 laptop. This is in an attempt to essentially get a locally generated replica of /usr/lib/libSystem.B.dylib, which I intend to experiment on further. I see a couple basic roadblocks though (unless, obviously, I'm missing something basic): No instructions on how to do the build. There are a couple of Makefiles in the URL I reference above, but they fail to build when I

OS X: Any way to DELAY loading of a DEPENDENT library (.dylib)?

◇◆丶佛笑我妖孽 提交于 2019-12-04 11:13:45
A C++ dependent library .dylib resides in a bundle located in the app package's Content/Frameworks. I'd like to DELAY the loading of that dependent library until I've completed some specific initialization. Is there any way OTHER THAN to create a Runtime-Loaded Library? Would using weak linking options prevent the .dylib from being loaded until first referenced? You mean lazy linking: ld -o test test.o -lazy_library /usr/lib/libz.dylib ld -o test test.o -lazy-lz Both load the Zlib compression library when a routine from it is first run. The problem is not to run the routines from your custom

Calling dlopen on ios

微笑、不失礼 提交于 2019-12-04 09:38:50
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 got a very basic iOS example where I manually do a dlopen followed by a dlsym to call a function in a

Dylibs and OS X

偶尔善良 提交于 2019-12-04 07:32:51
I am trying to run a program called vowpal-wabbit (version 6.0) in mac os x. I've used homebrew to install some things, such as lib tools and, importantly, boost. However -- I'm finding that, even though /usr/local/Cellar/boost/1.49.0/lib Clearly has all the boost libs, (including lib boost_program_options.dylib)... The error message i get when trying to run a binary is : dyld: Library not loaded: libboost_program_options.dylib I get the same (basically) error when running "make" to build this binary from scratch : ld: library not found for -lboost_program_options So ... I guess my question is