static-libraries

Required Framework vs Static Library

感情迁移 提交于 2019-12-03 23:50:36
Building Modern Frameworks says every app has its own copy of a custom framework . Now that Xcode supports iOS frameworks, is it still true that frameworks are static libraries but just more convenient ? If that's true, then why choose the static library template? Otherwise, should I convert all my required custom frameworks to static libraries once Swift supports static libraries ? dev gr Frameworks serve the same purpose as static and dynamic shared libraries, that is, they provide a library of routines that can be called by an application to perform a specific task. For example, the

Static library built for archive which is not the architecture being linked (x86_64)

时光总嘲笑我的痴心妄想 提交于 2019-12-03 23:50:22
I am experiencing what seems to be the same problem when I try to compile two different programs. Each of them creates first a static library and then the main application linking that library. I am working on Mac OS Mavericks with gcc 4.7.2. Program 1 This is what is happening when I run make : First, the library libfeat.a is created, but I get a warning: ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o ranlib ../lib/libfeat.a /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: ../lib/libfeat.a the

Two library of different versions in an application

↘锁芯ラ 提交于 2019-12-03 21:13:38
Consider a scenario where there are two shared library of different version.Consider A.1.so linked to B.so and A.2.so linked to C.so. Now both B.so and C.so are linked to d.exe . When B.so wants to invoke function in A.1.so, it ends up calling function in A.2.so .Because of this , it gives us undefined behaviour. Now I want my B.so invoke only A.1.so.I can only modify A.1.so and B.so , nothing else. Using dlopen() is one of the option, but for using dlopen() , I have to make heavy changes in B.so. There are many solutions given earlier in Stack Overflow, but nothing seems to work. Kindly note

Compiling ghc with -fPIC support

99封情书 提交于 2019-12-03 20:37:04
问题 I'm trying to install GHC with -fPIC support in Fedora. I've grabbed a source tarball since it seems no binary one has this. In Build.mk i've changed the quick build type to ifeq "$(BuildFlavour)" "quick" SRC_HC_OPTS = -H64m -O0 -fasm -fPIC GhcStage1HcOpts = -O -fasm -fPIC GhcStage2HcOpts = -O0 -fasm -fPIC GhcLibHcOpts = -O -fasm -fPIC SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO endif unfortunately, when compiling i still get the ld

Impossible to load an image in xcassets on bundle

我与影子孤独终老i 提交于 2019-12-03 19:56:07
问题 I need to include images in a static library. I created a bundle and inserted in my images, the problem is that it seems to work if I include the images directly in the bundle, but stops working if I put in a xcassets file. I followed many guides and searched for a solution on this site. The most popular solution is to insert this line of code: [UIImage imageNamed:@"MyBundle.bundle/imageName"] but it seems not work for me any ideas? 回答1: There are two ways to solve this, If your app is still

Duplicate symbol: Include static lib A in static lib B, also include lib A and B in XCode Project

一笑奈何 提交于 2019-12-03 19:26:41
问题 I've been trying to build up a set of reusable libraries for app development, but I'm starting to run into a problem. One of my static libs is a set of general use methods (categories on Objective-C Foundation classes to improve their usability) which I tend to use in every project. (We'll call it Lib A... i.e. XCode project A produces libProjectA.a) Then I have other static libs, things that contain specialized code for math, etc. (We'll call it Lib B.) Lib B links to Lib A because it needs

Android linker: undefined reference to bsd_signal

天大地大妈咪最大 提交于 2019-12-03 19:15:32
问题 I'm running gradlew to compile an Android app that has a static lib dependency. Somehow, I have an undefined reference to bsd_signal . I was able to compile this app with gradle 1.X, but I've been obliged to switch to gradle 2.10 and to drop my Android.mk file in favour of putting more build instruction into my gradle.build file, and this is where the trouble arises. Can anyone tell me whether there is a library that defines bsd_signal , which I should link to my project? Compiler output

How do I create both a .lib file and an .exe file in Visual C++?

流过昼夜 提交于 2019-12-03 17:30:57
问题 I currently have a console project which creates an .exe file; I want it to also create a .lib file so other projects, compiled as DLLs, would be able to call functions from the original project. I know it is possible, but I couldn't find how to do that. How do I tell the linker to also link a .lib? 回答1: It's not possible in general - static libraries and executables are completely different kinds of animal. The way to handle this situation is to create two projects - one for the library,

How can I build an Objective-C static library to distribute as a single binary and header file?

白昼怎懂夜的黑 提交于 2019-12-03 17:26:50
I'm building a static library, MyLibrary , for iOS in Objective-C that bundles together a dozen useful classes, each with its own .h file. I'd like to distribute MyLibrary as a single compiled binary, libMyLibrary.a , and a single .h header file, MyLibraryAPI.h . MyLibraryAPI.h has a dozen #import statements, one for each of MyLibrary 's dozen public classes. Developers who want to include MyLibrary in their host projects should only have to include the libMyLibrary.a binary and the MyLibraryAPI.h header. This is the goal. So I have set the Role of each public class in the MyLibrary Xcode

Xcode 4 build Static Library dependency with different configuration setting

大兔子大兔子 提交于 2019-12-03 17:20:54
问题 I was wondering whether it is possible to have dependant static library compiled with different configuration settings. My case was I have a project (project.pbxproj) which is dependant on a static library (cocoa touch) project (libStatic.pbxproj). My project has let say 3 configuration settings, like debug, release and ad-hoc, while my libStatic will only have 2 which is debug and release. So my question is, it is possible to have the ad-hoc configuration settings on the main project to