static-libraries

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

佐手、 提交于 2019-12-03 12:36:42
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 multiple projects. With some trial and error experience and troubleshooting, I found this solution

static library v.s. import library on Windows platform

妖精的绣舞 提交于 2019-12-03 12:31:05
How could I tell one .lib file is a static library v.s. an import library for a DLL? Is there any tool or command that could do this? Second question is how could I check the dependencies of a static library, I mean how could I know which DLLs are included in this static library? Thanks for any help here. Best regards, Import library will add a DLL dependency to your program. Your program won't start, if you don't have the DLL. (You may use Dependency Walker to get the names of the DLL's of your program depend on). Afaik Static libraries do not have dependencies. They linked into the program,

Size of a library and the executable

限于喜欢 提交于 2019-12-03 11:56:17
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 systems, that is how do sizes of library on linux (*.a/*.la file) relate with size of linux executable (*

C: Creating static library and linking using a Makefile

白昼怎懂夜的黑 提交于 2019-12-03 11:37:59
问题 I am trying to understand static and shared Libraries. I want to do the following to create a makefile that does separate compilation and linking such that a static library is created and linked in forming the final static executable. I have the following code for the Makefile, but I am getting the following error Makefile:13: *** missing separator. Stop. But I am also trying to understand how to actually link/create libraries. If I run the commands after line 12 in the terminal they work,

OSX: How do I convert a static library to a dynamic one?

久未见 提交于 2019-12-03 11:19:27
Suppose I have a third party library called somelib.a on a Mac running Mountain Lion with Xcode 4.4 installed. I want to get a dynamic library out of it called somelib.dylib. An appropriate Linux command would be: g++ -fpic -shared -Wl,-whole-archive somelib.a -Wl,-no-whole-archive -o somelib.so where -whole-archive and -no-whole-archive are passed to the linker. When I do the equivalent for Mac: g++ -fpic -shared -Wl,-whole-archive somelib.a -Wl,-no-whole-archive -o somelib.dylib ld fails with an error: ld: unknown option: -whole-archive It seems that the ld on OSX is different from GNU ld.

Can Clang compile code with GCC compiled .a libs?

↘锁芯ラ 提交于 2019-12-03 11:02:57
I have my project currently compiling under gcc. It uses Boost, ZeroMQ as static .a libraries and some .so libraries like SDL. I want to go clang all the way but not right now. I wonder if it is possible to compile code that uses .a and .so libraries that were compiled under gcc with clang? Yes, you usually can use clang with GCC compiled libraries (and vice versa, use gcc with CLANG compiled libraries), because in fact it is not compilation but linking which is relevant. You might be unlucky and get unpleasant suprises. You could in principle have some dependencies on the version of libstdc++

Compile PHP into Static Binary

我的未来我决定 提交于 2019-12-03 10:44:18
I need to run a php script on a system with a somewhat broken PHP install. Rather than trying to workaround the issues I want to just package my code with it's own PHP binary (I can execute an executable). I want to just have a simple php binary that has all the modules I need compiled in. My general process is: ./configure --enable-static --enable-cli --disable-all This gives me a php binary with no extensions. From here I can add the extensions I need. For example to add curl and json support ./configure --enable-static --enable-cli --disable-all --with-curl --enable-json This seems to work

Can a C++ Static Library link to shared library?

巧了我就是萌 提交于 2019-12-03 10:30:33
Say I have a static C++ lib, static.lib and I want to call some functions from a C++ shared lib, say shared.lib. Is it possible? Now assume that I have another shared lib, say shared2.lib which links to static.lib but does not link to shared.lib. Does the linker automatically link shared2.lib to shared.lib in this case? I am using Microsoft Visual Studio 2003. Static libraries are not linked. They are just a collection of object files (*.obj or *.o) that are archived together into a library file (kind of like a tar/zip file) to make it easier for the linker to find the symbols it needs. A

How to create static library from an existing framework in iOS?

感情迁移 提交于 2019-12-03 10:29:38
I have been provided with a framework by a third party vendor for an iPhone hardware accessory. So I have a folder like Device.framework. Inside that folder is a binary file and a set of .h files. There are instructions for how to add this to an iOS project and use the classes contained within. However, I'm actually using MonoTouch and want to use a static library. Is there a way to create a static library that makes all the classes from the framework available in the static library? So in my MonoTouch project I would link in the static library and have access to that framework. A *.framework

Include framework in Xcode static library?

故事扮演 提交于 2019-12-03 10:02:03
In short: Is there a way to create a static library in Xcode such that when clients link with that library, they also link with the frameworks upon which that library depends? The problem: We have a shared Xcode project which contains multiple static library targets containing all of our common code. E.g., If a project wants to use the shared networking code, all they should have to do is link in our Network library. The problem is that the libraries don't seem to "include" the frameworks on which they depend. E.g., our Sound library uses the AudioToolkit.framework. Even when the Sound library