dylib

What is the deal with undefined symbols in a shared library or dylib?

独自空忆成欢 提交于 2019-12-04 02:59:30
问题 I have a Makefile for linux that I am porting over to Darwin. The makefile takes a bunch of .o files and links them together into a .so shared object. Okay, so I figured (am I wrong about this?) that the best analog for this in Darwin is the dylib. So I changed the -shared flag to -dynamiclib. Now the code that I am linking together into the dylib depends on lots of external libraries. When I try to build the dylib, I get errors saying there are undefined references. But the Linux Makefile

weird ios libprotobuf.dylib cause crash

早过忘川 提交于 2019-12-03 21:11:15
i have my own protobuf compiled in the project (in the main target, not a lib), but I found a crash which is caused by protobuf code in libprotobuf.dylib ( which in my guess is a newly included lib in new version of device -- mine is ipad air). * thread #1: tid = 0x6598, 0x0027e96e TutorChat`void google::protobuf::internal::RepeatedPtrFieldBase::Destroy<google::protobuf::RepeatedPtrField<google::protobuf::UninterpretedOption>::TypeHandler>(this=0x1567158c) + 66 at repeated_field.h:814, queue = 'com.apple.main-thread, stop reason = breakpoint 2.41 frame #0: 0x0027e96e TutorChat`void google:

Load a Mac binary as a dynamic library

江枫思渺然 提交于 2019-12-03 17:01:02
问题 I am doing some reverse engineering with a binary executable without sources. On Windows what I can do is load an executable file (EXE) with LoadLibrary, just as it was a DLL file. If the loaded file is not relocatable I can simply relocate my loader code to "make space" for the other module. When I have the binary loaded, I can call it's functions (assuming I where where they are, of course), and do other stuff. Is there some way to do the same or similar on Mac? I have a mach-o executable,

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

本秂侑毒 提交于 2019-12-03 13:16:10
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 on here? I know that Objective-C has all the libraries I would need to do graphics and networking, but I

ld: library not found for -lz.1.2.3

↘锁芯ラ 提交于 2019-12-03 10:45:30
问题 When trying to compile the software for iOS 5, XCode 4.2 throws an error: ld: library not found for -lz.1.2.3 I found this post that tells me to replace 1.2.3. with 1.2.5 https://github.com/dbloete/ioctocat/issues/107 After doing what the link has suggested, it worked for XCode 4.2 but fails for older versions for XCode with the error ld: library not found for -lz.1.2.5 Has anyone encountered the above situation? How can I resolve this so that it will not fail between the different versions

Can I include dylib-s in my executable?

ⅰ亾dé卋堺 提交于 2019-12-03 09:53:36
问题 (Yes, I understand that the whole point of dylib is that it loads dynamically, but I'm trying to create a self contained package.) I've got an executable that I built from the command line -- on OS-X/Lion, if it matters. I delivered the executable to a friend, but he can't run it because he doesn't have the libraries installed. He'd rather not install the libraries, so now I'm trying to create a package that includes the original executable plus all the needed libs. I'm used to working in

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

女生的网名这么多〃 提交于 2019-12-03 07:52:25
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? I have added a C/C++ dylib library, with C Public API headers to Swift Project. Assume that the library is, libModule.dylib. Create a Directory with

How to build apple's opensource libc?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 07:19:21
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 try to do straightforward makes: $make -f Makefile Makefile:14: *** missing separator. Stop. I suspect

Load a Mac binary as a dynamic library

强颜欢笑 提交于 2019-12-03 05:58:51
I am doing some reverse engineering with a binary executable without sources. On Windows what I can do is load an executable file (EXE) with LoadLibrary, just as it was a DLL file. If the loaded file is not relocatable I can simply relocate my loader code to "make space" for the other module. When I have the binary loaded, I can call it's functions (assuming I where where they are, of course), and do other stuff. Is there some way to do the same or similar on Mac? I have a mach-o executable, and I'd like to load it as it was a dynamic library (DYLIB). Or is there some way to convert an

How do I create a working framework with dylib files in Xcode 4

蓝咒 提交于 2019-12-03 02:25:59
问题 I have created a new cocoa framework in Xcode, removed all the libraries and files it includes at the beginning except the supporting files. I have 2 files: add.h #ifndef add_add_h #define add_add_h void add(void); #endif and add.c #include <stdio.h> #include "add.h" void add(void) { printf("adfding"); } in build phases I add add.c to compile sources and add.h to compile headers public. The project build without a problem but in the framework there is no dylib file and when I drag and drop