static-libraries

Duplicate symbols issue with 2 third party libraries in Xcode

时间秒杀一切 提交于 2019-12-21 12:31:39
问题 I'm trying to compile a project that depends on 2 third party static libraries. The issue is that both third parties have included the same set of "utility" classes in their static library distribution, meaning that I am getting dozens of duplicate symbol errors when both are added to my project. Is there a way for me to force the project to compile and/or ignore one of the duplicate symbols somehow? I found a similar question with answer here two static libraries with duplicate symbols in

Can I statically link Cython modules into an executable which embeds python?

若如初见. 提交于 2019-12-21 12:11:53
问题 I currently have an executable compiled from C++ that embeds python. The embedded executable runs a python script which load several Cython modules. Both the Cython modules and the executable are linked against a shared library. I want to move the shared library into the executable by statically linking the shared library against the executable. Can I statically link the Cython modules into the executable which embeds python? What is the best way to handle this situation? 回答1: Yes it's

Required Framework vs Static Library

冷暖自知 提交于 2019-12-21 07:12:20
问题 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? 回答1: Frameworks serve the same purpose as static and dynamic shared libraries, that is, they provide a library of

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

六眼飞鱼酱① 提交于 2019-12-21 05:15:11
问题 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

Static library gives error on iOS simulator and works on iOS device

我们两清 提交于 2019-12-21 04:59:06
问题 Currently I'm working on a iOS application (iOS 6), In which I need to implement a static library. I successfully implemented the Static library using this tutorial. And I successfully added the static library to other project and Installed the app to iPhone !. It's working successfully. But my issue is when I tried to run it on my simulator some errors are coming: "_OBJC_CLASS_$_MMPAlert", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang

What is the meaning of “Warning: Linking the shared library against static library is not portable”?

痞子三分冷 提交于 2019-12-21 04:15:27
问题 I am making one dynamic library by using some function of libmxml.a library but I get this warning: *Warning: Linking the shared library libgstmatroskademux.la against the _ *static library /home/Mr32/gst-template4_final/gst-plugin/src/libmxml.a _ is not portable! I also get this warning: gcc: /home/Mr32/gst-template4_final/gst-plugin/src/libmxml.a: linker _ input file unused because linking not done So what's the meaning of this warning and how could I solve it? Edit : There is one already

Size of a library and the executable

隐身守侯 提交于 2019-12-21 04:09:04
问题 I have a static library *.lib created using MSVC on windows. The size of library is say 70KB. Then I have an application which links this library. But now the size of the final executable (*.exe) is 29KB, less than the library. What i want to know is : Since the library is statically linked, I was thinking it should add directly to the executable size and the final exe size should be more than that? Does windows exe format also do some compression of the binary data? How is it for linux

Xcode 4, Interface Builder and the Awareness of Classes in a Static Library

大兔子大兔子 提交于 2019-12-21 03:52:31
问题 Although Xcode 4 is advertised being aware of cross-project classes of projects in a shared workspace, I didn't find this working and did some research about the problem. The common solution discussed in many threads around here is, to create a static library and link your projects against it. I therefore followed Jonah's guide (http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/) and created a static library to share frequently used subclasses of UIView with

Why would the size of the final binary be so much smaller than the size of the static library?

假装没事ソ 提交于 2019-12-21 03:41:15
问题 This is an iOS question. I build a static library (a framework in iOS) which is then included in an app. The size of the result binary (500kb) is smaller than the size of the static library (6mb). How does this work? My understanding of static library is that the static library is included in the final binary 回答1: Because you are not using all the functions of your library. A static library of archive type .a is a collection of .o object files and only the object files needed in your program

Including header file from static library

∥☆過路亽.° 提交于 2019-12-21 03:32:57
问题 I am making a test setup of a C static library and program. The library code, located in a subdirectory 'foo' of my project, contains the following files: foo/foo.c: #include <stdio.h> void foo(void) { printf("something"); } foo/foo.h: #ifndef foo_h__ #define foo_h__ extern void foo(void); #endif My progam code is as follows: test.c: #include "foo.h" int main() { foo(); return 0; } I have a build script, called 'build', which contains the following: build: #!/bin/bash gcc -c -Wall -Werror foo