dylib

How To Call my Qt/C++ Dylib from Objective C?

孤街浪徒 提交于 2019-12-01 01:30:28
I've compiled a dylib in Qt/C++. I created a simple class method called test() that reads a string input and returns a string output with "-response" back. Now how do I load that inside Objective C in XCode 7 (a default Cocoa application) and make it emit test() via NSLog() ? This is what my build folder looks like in Qt/C++. You need to use an Objective-C++ class, which is a hybrid of Objective-C and C++. The greatest challenge using one or more Objective-C++ classes in a largely Objective-C project is avoiding exposing C++ classes to the Objective-C classes. Therefore you need to avoid C++

unload dynamic library needs two dlclose() calls?

本小妞迷上赌 提交于 2019-11-30 19:27:34
I have a dynamic library which I load using dlopen() and then unload using dlclose() ; If I dont include any objective c code dlopen() needs one dlclose() call which is expected behavior. But when I include any objective c code to target, I have problem that I need to do two dlclose() calls to the loaded library in order to unload. Is this something expected behavior? How can I fix it? I realize that you are using dlopen , not CFBundle or NSBundle . Nevertheless, the Code Loading Programming Topics manual says this: In Cocoa applications, you should not use CFBundle routines to load and unload

dyld not loaded Reason: image not found libopencv_core.2.4.dylib

。_饼干妹妹 提交于 2019-11-30 18:31:24
I'm still quite new to Objective C and Xcode, but I just finished a small app that uses the openCV libopencv_core.2.4.2.dylib . When I went to open the final built app on another machine , OS X threw me this error: Dyld Error Message: Library not loaded: */libopencv_core.2.4.dylib Referenced from: /Users/USER/Desktop/my app.app/Contents/MacOS/my app Reason: image not found Why is my app looking for 2.4 instead of 2.4.2 here? What I already checked: I added a new build phase -> so that libopencv_core.2.4.2.dylib is copied to the app package (via "Copy Bundle Resources" in Xcode) - libopencv

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

限于喜欢 提交于 2019-11-30 16:12:20
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? 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 flat.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL

Hiding the symbols of a static library in a dynamic library in MAC OS X?

给你一囗甜甜゛ 提交于 2019-11-30 14:04:35
问题 I am using a static library (eg: boost.a) and some *.o files to create a dynamic library (Eg: libdynamic.dylib) in MAC OS X. I am able to hide the symbols from the *.o files since I created those by -fvisibility=hidden flag. But, I can't hide the symbols from boost.a library since they have been compiled already. Is there any way to hide the symbols (functions) of the static library, in the dynamic library ? i.e., If I have a function (hidden) in myfuncs.o file which calls the functions

Compile simple hello world ZeroMQ C example, compile flags?

大憨熊 提交于 2019-11-30 12:07:08
问题 Trying to compile the example hello_world.c from the zeromq tutorial: http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive Pretty sure I have everything installed in OSX Mountain Lion. clang -Wall hwserver.c -o hwserver gives me an error: Undefined symbols for architecture x86_64: "_zmq_bind", referenced from: _main in hwserver-OgrEe6.o "_zmq_ctx_new", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg_close", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg_data", referenced

How to set dyld_library_path in Xcode

十年热恋 提交于 2019-11-30 07:46:05
I am new to Xcode and Mac environment. I am using some dynamic and static libraries like boost, Clucene, etc. I have all the libraries under MyApp.app/Contents/Resources I want to set this path as the app's dyld_library_path. I tried editing XXX.plist file like DYLD_LIBRARY_PATH /mypath/xxx and setting the environment variable and argument in Xcode Nothing work. but if I run a shell script like below without double clicking the app in my .dmg it works #!/bin/bash clear cd /Volumes/xxx/myapp.app/Contents/MacOS export DYLD_LIBRARY_PATH="/Volumes/xxx/myapp.app/Contents/Resources" ./myapp I am

Attaching sources to a binary dylib in Xcode

痞子三分冷 提交于 2019-11-30 06:25:49
I've a framework with a dylib in my iOS app which was compiled on another machine. I checked out the sources on my machine and tried instructing lldb to map the source code path using: settings set target.source-map /source/code/path/in/dylib/prefix /source/code/path/on/my/machine/prefix To no avail, still seeing assembly. Note #1: the dylib was compiled from C++ code in the same version of Xcode. Note #2: I'm used nm -pa /path/to/dylib to determine whether file paths are embedded into the debug info, and they are, lldb doesn't play along for some reason. Thanks UPDATE I've followed Jim Ingham

creating a .dll on a mac: .dylib or framework?

送分小仙女□ 提交于 2019-11-30 05:07:32
I need to create a Mac version of our libraries for one of our customers. I am not so familiar with dynamic libraries on Mac, but from what I understand, I have 2 options: .dylib or frameworks. What would be the best option? Why? Few related questions: If I understand correctly, .dylib have to be installed in one of the stnadard UNIX directories such as /usr/lib, etc. Hence using a .dylib should make my customer's installer much more complex, since they'll probably need to request permission to write something in a system folder? Can frameworks be private and embedded within my customer's

dylib @executable_path path issue in a plug-in bundle

北战南征 提交于 2019-11-30 05:02:58
I am developing a plug-in bundle , say MyPlugIn.bundle for an application , say BigApp.app . This bundle requires a dylib , say MyPlugIn.bundle/Contents/Resources/library.dylib . I have relocated paths for library.dylib, as I would have done for a simple application bundle: $ otool -L MyPlugIn.bundle/Contents/MacOS/MyPlugIn MyPlugIn.bundle/Contents/MacOS/MyPlugIn: @executable_path/../Resources/library.dylib (compatibility version 0.0.0, current version 0.0.0) [...] $ otool -L MyPlugIn.bundle/Contents/Resources/library.dylib MyPlugIn.bundle/Contents/Resources/library.dylib: @executable_path/..